ITADN

Server returns 200 (soft 404) for non-existent routes instead of a real 404

#6463OpenAlek99 创建于 2026-05-06
bug
A
Alek99commented
**Describe the bug** Reflex apps return HTTP 200 for URLs that don't correspond to any real page, serving the SPA fallback as the response body. This is a soft 404: the page doesn't exist, but the server signals success. Crawlers, AI agents, and SEO tooling all treat the response as a valid page and try to extract content from what is effectively an error state. The root cause is that the SPA fallback is doing double duty. It's how Reflex resolves dynamic routes and other runtime-resolved paths *and* it's what gets served when a URL doesn't match anything. Both cases hit the same fallback, so the server can't distinguish "valid dynamic route" from "nonexistent page" We need to be able to distinguish between the two **To Reproduce** 1. Deploy any Reflex app. 2. Request a URL that doesn't map to a defined page, e.g. `/this-page-does-not-exist`. 3. Observe: response is `200 OK` with the SPA fallback HTML. 4. Expected: `404 Not Found`.
1 条评论