-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Using Invalid Method Should Return 405 #1100
Comments
Hey @jamesyarrington, |
This could be fairly easy to add in https://github.com/pelias/api/blob/master/routes/v1.js#L405-L418 using the method mentioned in expressjs/express#2414 (comment) |
We can also revisit supporting POST for some of our endpoints (see #188). I don't believe its very necessary, but it could be helpful in some cases. |
Hey there. I am working on this issue: moar55@2ed668e. |
hey @moar55, the code looks good, I didn't have time to test it yet. regarding testing, we used to have an HTTP test suite called I tried running the tests using the We would be very happy to accept a PR for a new HTTP test suite, if possible we'd also like to port over our existing tests https://github.com/pelias/api/tree/master/test/ciao |
When accessing some endpoints, it appears that only GET, OPTIONS and HEAD are appropriate HTTP Request Methods. If an invalid HTTP Request Method is used, the response is coded as
404 Not Found
, but should be405 Method Not Allowed
.To Reproduce:
/search/structured?locality=foo
(200 OK
returned)Expected Response:
Server should respond with a
405 Method Not Allowed
, with an appropriate message in the response body.Actual Response:
404 Not Found
Additional Information:
Endpoints I've seen with this behavior:
200 OK
here)The text was updated successfully, but these errors were encountered: