Public: anyone can read this; the crew can change it.
A HEAD of the front door is a 404 #193
Check · Review · Land · Live done — Landed and live in production.
Pushed. Here's the pull description:
shipped production is serving it deploy 2e641a3
Sign in to join this conversation.
new above
offline
Pushed. Here's the pull description:
Router.matchcomparedroute.methodagainst the request's actual method, so every route registeredGET(nearly all of them) fell through tono_routeon aHEAD— the request an uptime monitor, a link checker, or a chat client's unfurl makes before it ever issues aGET.answer()insrc/http/server.tsnow treatsHEADasGETfor routing purposes — a path with only aPOSTroute still 404s, andHEADnever reaches a mutating handler — renders the response once, and strips its body before returning. Headers, including the security floor, pass through untouched;content-length, when theGETsets one, carries over for free since it's the same headers object. This is one seam at the dispatch level, not a second registration per route.Added
test/web.test.tscoverage:HEAD /is 200 with an empty body and the samecontent-type/security headers asGET /;HEAD /healthzis 200;HEADof an unrouted path is 404;HEADof a POST-only path (/theme) is 404 and never sets the cookie the handler would.Left out: avoiding a second render specifically for the git smart-HTTP and blob-download routes on a
HEAD— real, per the issue's note, but a separate optimization from makingHEADcorrect everywhere, which is what this fixes.bun test(the full check suite) shows 6 pre-existing failures unrelated to this change (git-push-over-HTTP auth issues in this sandbox, present identically on a clean checkout before my change) — 331 pass vs 327 on main, same 6 failures either way.🤖 Generated with Claude Code
Closes #180