Skip to content
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

fix: auto reply to OPTIONS requests only when unhandled #4559

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

alan-agius4
Copy link
Contributor

@alan-agius4 alan-agius4 commented Sep 6, 2022

Prior to this change the internal options middleware always responded to such requests. This is because the middleware was registered too early and was not being used as a fallback. With this change we register this middleware as the last middleware to ensure that this is only used as a fallback when OPTIONS requests are not handled.

Closes #4551

Prior to this change the internal options middleware always responsed to such requests. This is because the middleware was registered too early and was not being used as a fallback. With this change we register this middleware as the last middleware to ensure that this is only used as a fallback when OPTIONS requests are not handled.

Closes webpack#4551
@codecov
Copy link

codecov bot commented Sep 6, 2022

Codecov Report

Merging #4559 (cb813e4) into master (85dcb31) will increase coverage by 0.12%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #4559      +/-   ##
==========================================
+ Coverage   92.06%   92.19%   +0.12%     
==========================================
  Files          16       16              
  Lines        1639     1639              
  Branches      617      617              
==========================================
+ Hits         1509     1511       +2     
+ Misses        119      117       -2     
  Partials       11       11              
Impacted Files Coverage Δ
lib/Server.js 93.75% <100.00%> (ø)
lib/servers/WebsocketServer.js 94.87% <0.00%> (+5.12%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks for the PR ⭐

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.

Automatically replying to OPTIONS requests is potentially problematic
3 participants