Skip to content

fix: send Allow header on OPTIONS response - #435

Open
webdevelopersrinu wants to merge 1 commit into
expressjs:masterfrom
webdevelopersrinu:add-allow-header
Open

webdevelopersrinu wants to merge 1 commit into
expressjs:masterfrom
webdevelopersrinu:add-allow-header

Conversation

@webdevelopersrinu

Copy link
Copy Markdown

Fixes #305

When this middleware answers an OPTIONS request it ends the response
itself, so Express never gets to add the Allow header it normally sends.
I set the Allow header from the configured methods before ending the
response.

Added two tests, one for default methods and one for custom methods.
All tests pass with 100% coverage.

Express sets Allow on OPTIONS itself, but this middleware ends the
response before Express gets the chance. Now we set it from the
configured methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OPTIONS request handler missing Allow header

1 participant