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(cors): append access-control-max-age header to preflight response #856

Merged
merged 6 commits into from
Oct 3, 2024

Conversation

aaharu
Copy link
Member

@aaharu aaharu commented Aug 8, 2024

resolves #854

@aaharu aaharu requested a review from pi0 as a code owner August 8, 2024 06:43
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.45%. Comparing base (a58d7c9) to head (4ba3732).
Report is 186 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #856      +/-   ##
==========================================
+ Coverage   77.83%   79.45%   +1.62%     
==========================================
  Files          47       43       -4     
  Lines        4286     3291     -995     
  Branches      611      797     +186     
==========================================
- Hits         3336     2615     -721     
+ Misses        933      673     -260     
+ Partials       17        3      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pi0
Copy link
Member

pi0 commented Aug 29, 2024

Can you please add a regression test?

@pi0 pi0 changed the title fix: append access-control-max-age header to preflight response fix(cors): append access-control-max-age header to preflight response Aug 29, 2024
@aaharu
Copy link
Member Author

aaharu commented Aug 30, 2024

I added tests and fixed the Access-Control-Expose-Headers issue as well.
https://fetch.spec.whatwg.org/#http-responses

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

Access-Control-Expose-Headers

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit d9a43dd into unjs:main Oct 3, 2024
5 checks passed
@aaharu aaharu deleted the cors-maxage branch October 4, 2024 00:32
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.

handleCors's maxAge option has no effect
2 participants