Skip to content

Sending 404 status code when the routes don't match #799

Open
@sidvenu

Description

@sidvenu

Is your feature request related to a problem? Please describe.
I observe router sends 200 status code when no routes match.

Describe the solution you'd like
Allow us to send status codes based on the path.

Describe alternatives you've considered
Sending 404s in the server (apache/nginx) layer, but that gets complicated as we have a lot of routes.

Additional context
React Router has the ability to send status codes: https://stackoverflow.com/questions/36052604/how-to-let-react-router-respond-with-404-status-code.

I've also opened a similar issue in preactjs/preact-router: preactjs/preact-router#402.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions