fix(web): 404 fallback returns a real 404, not a soft-404 200 (BUNYIP-186) #205
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-186-not-found-404-status"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Makes bunyip-web's catch-all fallback return a real HTTP 404 instead of a soft-404 (200), while still rendering the branded "Page not found" page (BUNYIP-186).
Why
not_found(handlers/public.rs) returned the 404 page viahtml(...)= HTTP 200, so every unmatched path answered200 OK. Soft-404s mislabel missing resources to crawlers / monitoring / caches and hide routing gaps. It also directly complicated BUNYIP-185: a fallback that returns 200 for any path made a status-only/healthzliveness probe meaningless, forcing it to validate the response body.How
web::html_status(markup, StatusCode)helper (mirrorshtml(); sets the status on the built response).not_foundnow returnsStatusCode::NOT_FOUNDwith the same page.Only the fallback changes; real routes are untouched. Nothing depended on the old 200 - the
/healthzprobe already body-validates.Verified
clippy -p bunyip-web --all-targets -D warnings+fmt --all --checkclean.🤖 Generated with Claude Code