Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add HEAD to CORS ALL_METHODS list (#1112)
* Add HEAD to CORS ALL_METHODS list The HEAD method is conspicuously absent from the allowed methods list when `allow_methods="*"` is used. This doesn't really affect CORS preflight requests, as HEAD requests aren't preflighted by the browser, but it does prevent the actual cross-origin HEAD response from being read by the calling app. [This can catch people off-guard.](https://discuss.encode.io/t/for-cors-middleware-why-is-head-not-included-in-all-methods/939) This simply adds HEAD to the `ALL_METHODS` list in the CORS middleware module and includes some additional tests to validate the new behavior. * Update tests/middleware/test_cors.py to use more explicit status code check Co-authored-by: euri10 <euri10@users.noreply.github.com> Co-authored-by: euri10 <euri10@users.noreply.github.com> Co-authored-by: Jamie Hewland <jhewland@gmail.com>
- Loading branch information