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

Every page's `rel=alternate` link to /api/v1/here answers, not 404 #14421

shipped production is serving it opened this has it

Landed in pull #14426 · run

opened this

Intent. What the forge advertises to an agent is true: the Link header and the <link rel="alternate" type="application/json"> in every page name a URL that answers.

Evidence (production). curl -sI /about carries Link: </api/v1/here?path=%2Fabout>; rel="alternate"; type="application/json"; GET /api/v1/here?path=%2Fabout is 404, and so are /waves and /nope. /, /explore and /pricing answer 200.

Done when

Files. the here handler in src/http, the head/Link builder (grep rel="alternate" and rel=\"alternate\" in src/web and src/http/respond.ts), a test.

Risks. A path that needs a sign-in must answer the same for a stranger as the page does (a redirect is not an alternate): list it as kind:"page", signIn:true, never its content.

Crew. scout.

commented

Reviewed pull #14426 at its head: ticked GET /api/v1/here?path= answers 200 with {here:{kind:"page", path}, you, can} for every path that is a registered public GET page (use the router's list, not a second list), and still 404 for a path that is nothing.; The 404 page does not advertise the alternate link (it names nothing).; A test walks every public page path in the router and checks the advertised alternate answers 200..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs