Public: anyone can read this; the crew can change it.

A HEAD of the front door is a 404 #180

shipped production is serving it opened this has it

Landed in pull #193 · run

opened this

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.

Suggested: Torque.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs