You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Start: page route returns 500 when Accept excludes HTML #7913
Hitting this on a public marketing site that publishes agent-readable documents (llms.txt, an agent guide, a small OpenAPI spec) next to the normal HTML pages.
Several LLM fetchers send Accept: text/markdown with no */* fallback. Every page route answers them with 500 {"error":"Only HTML requests are supported here"}. An automated agent-readiness audit flagged the site as failing content negotiation, which is how I found it. From the client side the whole site looks broken, not merely non-negotiable.
Two things I ran into while working around it:
Global request middleware cannot fix this.executeRouter reads request from the startRequestResolver closure, so the Accept check always inspects the original Request, even when middleware ran first and produced a modified one. The only place to intervene is the server entry, rewriting the header before handler.fetch.
406 alone would not help much. It is the correct status and I would still like it. But an app that wants to serve something for these requests (a markdown rendering of the page, or a redirect to a .md variant) needs a way to opt out of the check, not a politer refusal.
Would you consider making the accepted list configurable on createStart?
Default unchanged, and 406 when negotiation genuinely fails. That would let apps handle markdown in a route or middleware, and keep current behaviour for everyone else.
Every one passes the current check. I found no named fetcher sending bare text/markdown.
What actually hit me was an agent-readiness audit probing negotiation without a fallback — a conformance checker, not crawler traffic. Much narrower than what I wrote.
The middleware point doesn't depend on it, though. executeRouter is invoked as executeRouter(ctx.context, matchedRoutes) and takes no request, so the Accept check reads request from the startRequestResolver closure. Middleware can run first and produce a modified request, and the check still inspects the original — the server entry is the only place to intervene. (Checked against 1.168.x.)
And @ollipa's original report — application/json / image/webp returning 500 — stands regardless of any of this; 406 is still the right answer there.
So treat supportedMimeTypes as resting on the middleware limitation rather than on traffic, and close it if that's too thin.
Activity
guillempuche commentedon Aug 22, 2026
Hitting this on a public marketing site that publishes agent-readable documents (
llms.txt, an agent guide, a small OpenAPI spec) next to the normal HTML pages.Several LLM fetchers send
Accept: text/markdownwith no*/*fallback. Every page route answers them with500 {"error":"Only HTML requests are supported here"}. An automated agent-readiness audit flagged the site as failing content negotiation, which is how I found it. From the client side the whole site looks broken, not merely non-negotiable.Two things I ran into while working around it:
Global request middleware cannot fix this.
executeRouterreadsrequestfrom thestartRequestResolverclosure, so theAcceptcheck always inspects the originalRequest, even when middleware ran first and produced a modified one. The only place to intervene is the server entry, rewriting the header beforehandler.fetch.406alone would not help much. It is the correct status and I would still like it. But an app that wants to serve something for these requests (a markdown rendering of the page, or a redirect to a.mdvariant) needs a way to opt out of the check, not a politer refusal.Would you consider making the accepted list configurable on
createStart?Default unchanged, and
406when negotiation genuinely fails. That would let apps handle markdown in a route or middleware, and keep current behaviour for everyone else.schiller-manuel commentedon Aug 23, 2026
which ones?
guillempuche commentedon Aug 30, 2026
I can't back that up, so I withdraw it.
Checkly's February survey of seven coding agents found three that request markdown, and all three carry a fallback:
text/markdown, text/html, */*text/markdown,text/html;q=0.9,…,*/*;q=0.5text/markdown;q=1.0,…,text/html;q=0.7,*/*;q=0.1Every one passes the current check. I found no named fetcher sending bare
text/markdown.What actually hit me was an agent-readiness audit probing negotiation without a fallback — a conformance checker, not crawler traffic. Much narrower than what I wrote.
The middleware point doesn't depend on it, though.
executeRouteris invoked asexecuteRouter(ctx.context, matchedRoutes)and takes no request, so theAcceptcheck readsrequestfrom thestartRequestResolverclosure. Middleware can run first and produce a modified request, and the check still inspects the original — the server entry is the only place to intervene. (Checked against 1.168.x.)And @ollipa's original report —
application/json/image/webpreturning 500 — stands regardless of any of this;406is still the right answer there.So treat
supportedMimeTypesas resting on the middleware limitation rather than on traffic, and close it if that's too thin.EdwardSalkeld commentedon Sep 24, 2026
This issue was fixed by @schiller-manuel as part of #8204
See
router/packages/start-server-core/src/createStartHandler.ts
Line 699 in ddad69a