Skip to content

Fix/spa fallback status code - #221

Merged
cupcakearmy merged 6 commits into
mainfrom
fix/spa-fallback-status-code
Sep 26, 2026
Merged

cupcakearmy merged 6 commits into
mainfrom
fix/spa-fallback-status-code

Conversation

@cupcakearmy

Copy link
Copy Markdown
Owner

No description provided.

matheuslealpa and others added 6 commits September 3, 2026 16:09
`ServeDir::not_found_service` wraps the fallback in `SetStatus`, which forces
every response to `404 Not Found`. Client side routes such as `/note/<id>` and
`/about` were therefore served the correct `index.html` but with a 404 status.

Use `ServeDir::fallback` instead, which leaves the status untouched. A note that
genuinely does not exist is still reported as 404 by `/api/notes/<id>`.

Behind a reverse proxy this made effectively every document request show up as a
4xx, skewing error rate dashboards and triggering false alerts.

Fixes #217
@cupcakearmy
cupcakearmy merged commit f6ea637 into main Sep 26, 2026
1 check passed
@cupcakearmy
cupcakearmy deleted the fix/spa-fallback-status-code branch September 26, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants