-
Notifications
You must be signed in to change notification settings - Fork 56
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
Correct error codes for unsupported requests. #86
Comments
Why not return 405 everywhere? |
Well if you try to make a request using |
Do you think that because the GETT method can't possibly exist? There are a few RFCs out there that define their own methods. Most notably WebDAV and CalDAV with MOVE, COPY, MKCOL, MKCALENDAR, PROPFIND |
That's what I meant. I guess 405 does make sense everywhere then. Some servers do return this but it's inconsistent: $ for url in google.com mozilla.org reddit.com microsoft.com rust-lang.org github.com facebook.com amazon.com; do echo $url '->' $(curl -X GETT -w '%{http_code}' -o /dev/null -s -L $url); done
google.com -> 405
mozilla.org -> 200
reddit.com -> 429
microsoft.com -> 400
rust-lang.org -> 403
github.com -> 403
facebook.com -> 400
amazon.com -> 503 501 NOT IMPLEMENTED might also be a good choice. |
If the request is not in {GET, HEAD, PUT, POST, DELETE, TRACE, CONNECT, PATCH} then it should return 400 BAD REQUEST.
If the request is not in {GET, HEAD} then iron can return 405 METHOD NOT ALLOWED.
(On from #54).
The text was updated successfully, but these errors were encountered: