Implement a default OPTIONS handler and complement the handler for HTTP 405 in router #743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello.
#388 did implement a handler for
405 Method Not Allowed
. But it does not set theAllow
header, which is a must according to RFC7231.Following #51 (comment), I am drafting a supplementary implementation for handling
405 Method Not Allowed
.Besides and based on that, it appears to be trivial to implement a default handler for the HTTP method
OPTIONS
(unrelated to CORS) withAllow
set. Compared to the former, the difference is just the response status.After finishing the commit and before submitting the PR, I notice it has an intersection with #104. But the latter has not been updated for a long while and the codebase has changed a lot since then, so I think it is worth opening another.
There are still some problems to solve. Let me add them in review comments below.