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

Correctly set Access-Control-Expose-Headers field and do not call prelfight handlers twice #34

Closed
wants to merge 3 commits into from

Conversation

KilianB
Copy link

@KilianB KilianB commented Dec 4, 2023

Fix issue: #33

The usage of the exposedHeaders.length instead of the allowedHeaders.length didn't surface because the app.onRequest handler is also run for preflights which has overwritten all headers set inside the preflight handler anyways.

The route handler will call into the onRequest method where the headers are set identical to how they are treated for the normal non preflight requests. handleOrigin and handleMethod are called twice without this patch
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.

1 participant