Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router returns 404 if route exists but method does not match #32

Open
algermissen opened this issue Oct 15, 2017 · 1 comment
Open

Router returns 404 if route exists but method does not match #32

algermissen opened this issue Oct 15, 2017 · 1 comment

Comments

@algermissen
Copy link

When registering a route with GET /test and I send a POST request to /test, the return is 404.

It should be 405 Method Not Allowed.

@brokenthorn
Copy link

brokenthorn commented Oct 2, 2018

This needs to keep track of or check endpoints and all their defined methods since 405 is used to signal that the endpoint is good but the method used is not allowed (and the response should contain an Allow header). For example, read-only endpoints. 404 is used to signal an invalid endpoint. But this behavior is something that would be expected of a REST implementation. A custom router/route could apply this REST specific implementation by returning 405 for a particular endpoint and a particular method.

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

No branches or pull requests

2 participants