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
feat: Add Allow Header on 405 #560
Conversation
The Allow header must be sent if the server responds with 405 to indicate which request methods can be used. See cdimascio#467
Adds Allow header to 405 error. This is required by RFC 7231 and indicates which request methods can be used. Resolves cdimascio#467
When using a custom error handler like in the NestJS example, one needs to set the headers on the response explicitly. The same is true when using a custom express error handler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff. thanks!
@ahilke I'm seeing a test failure on node 10 that is related to allow header. Appreciate it if u can have a look. Thanks!
|
@cdimascio Interesting, I was not aware that different node versions could treat key order differently. The order of the methods in the Allow header should not matter, so I adjusted the test case to ignore order in #562. |
Resolves #467
A few notes: