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: Access-Control-Expose-Headers set on preflight #84

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

griest024
Copy link
Member

Access-Control-Expose-Headers should be only the full request, NOT the preflight:

An HTTP response to a CORS request that is not a CORS-preflight request can also include the following header

https://fetch.spec.whatwg.org/#http-access-control-expose-headers

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Access-Control-Expose-Headers is set on the preflight request and NOT on any other requests.

What is the new behavior?

Access-Control-Expose-Headers is ONLY set on requests that are not preflight.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

`Access-Control-Expose-Headers` should be only the full request, NOT the preflight:

> An HTTP response to a CORS request that is not a CORS-preflight request can also include the following header

https://fetch.spec.whatwg.org/#http-access-control-expose-headers
Copy link
Member

@damienwebdev damienwebdev left a comment

Choose a reason for hiding this comment

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

lgtm

@damienwebdev damienwebdev merged commit f2515c8 into master Feb 7, 2024
@damienwebdev damienwebdev deleted the fix/expose-headers-on-preflight branch February 7, 2024 22:01
@gray-bot gray-bot mentioned this pull request Feb 7, 2024
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