Skip to content

fix: Don't treat OPTIONS as CORS preflight if request-method not set#1158

Merged
seanmonstar merged 1 commit intoseanmonstar:masterfrom
tkanakamalla:notcors
Apr 15, 2026
Merged

fix: Don't treat OPTIONS as CORS preflight if request-method not set#1158
seanmonstar merged 1 commit intoseanmonstar:masterfrom
tkanakamalla:notcors

Conversation

@tkanakamalla
Copy link
Copy Markdown
Contributor

As per the spec (https://fetch.spec.whatwg.org/#http-requests) and the MDN docs (https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request), a CORS preflight request should include at least the Origin as well as Access-Control-Request-Method headers in the OPTIONS request.

So we should not consider an OPTIONS request as a CORS preflight request if it does not include the Access-Control-Request-Method header and instead return Validated:::NotCors, so it will pass through

As per the spec (https://fetch.spec.whatwg.org/#http-requests) and
the MDN docs (https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request),
a CORS preflight request should include at least the Origin as well as
Access-Control-Request-Method headers in the OPTIONS request.

So we should not consider an OPTIONS request as a CORS preflight request
if it does not include the Access-Control-Request-Method header and instead
  return Validated:::NotCors, so it will pass through
Copy link
Copy Markdown
Owner

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@seanmonstar seanmonstar merged commit d7f6fdd into seanmonstar:master Apr 15, 2026
10 checks passed
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.

2 participants