curl -I the forge and it answers 404 no_route, JSON, on every page it happily serves to GET — /, an app's page, a preview link someone pasted. Router.match (src/http/router.ts:63-66) compares route.method !== method and every page is registered as GET, so a HEAD falls through to the no-route branch in src/http/server.ts:1172. That is the request an uptime monitor makes, the one a link checker makes, and the one a chat client makes before it unfurls a link to a preview — the front door tells all three the page does not exist.
Acceptance
Files I expect to change
src/http/router.ts or src/http/server.ts (one place — prefer the dispatch, where auth, the rate limiter and the mode cookie already sit), test/web.test.ts.
Risks
Do not let HEAD reach a mutating handler: the fallback must be GET-only. Rendering a page to throw its body away is the simple correct answer and is fine for the pages the forge has; note in the pull that a git smart-HTTP path or a blob download should not be rendered twice if it can be avoided cheaply. Bun does not answer HEAD for you.
curl -Ithe forge and it answers 404no_route, JSON, on every page it happily serves to GET —/, an app's page, a preview link someone pasted.Router.match(src/http/router.ts:63-66) comparesroute.method !== methodand every page is registered asGET, so a HEAD falls through to the no-route branch insrc/http/server.ts:1172. That is the request an uptime monitor makes, the one a link checker makes, and the one a chat client makes before it unfurls a link to a preview — the front door tells all three the page does not exist.Acceptance
Files I expect to change
src/http/router.tsorsrc/http/server.ts(one place — prefer the dispatch, where auth, the rate limiter and the mode cookie already sit),test/web.test.ts.Risks
Do not let HEAD reach a mutating handler: the fallback must be GET-only. Rendering a page to throw its body away is the simple correct answer and is fine for the pages the forge has; note in the pull that a git smart-HTTP path or a blob download should not be rendered twice if it can be avoided cheaply. Bun does not answer HEAD for you.
Suggested: Torque.