Skip to content

fix(spa): missing static assets return index.html with 200 instead of 404 #310

Description

@ajianaz

What

spa_handler (crates/trapfalld/src/spa.rs) falls back to serving index.html (200, text/html) for any unmatched path — including /_app/immutable/entry/start.*.js and other extension-bearing asset URLs.

Why it's a problem

Suggested fix

If the path looks like a static asset (has a file extension, or starts with _app/, favicon, robots), return 404 when Assets::get() misses. Only fall back to index.html for extension-less SPA routes.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions