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

CORS: allow requested method & headers values in CORS response #20

Conversation

paulRbr
Copy link
Member

@paulRbr paulRbr commented Feb 4, 2025

This is a fix to be able to allow CORS requests when they use specific
headers.

Until now we would limit to a set of headers that we
decided (Content-Type, Authorization, X-Requested-With and the proxy
token header). But this won't work for users needing to send custom
headers in their requests.

Code was inspired by https://github.com/Rob--W/cors-anywhere/blob/70aaa22b3f9ad30c8566024bf25484fd1ed9bda9/lib/cors-anywhere.js#L59-L66

This is a fix to be able to allow CORS requests when they use specific
headers.

Until now we would limit to a set of headers that we
decided (Content-Type, Authorization, X-Requested-With and the proxy
token header). But this won't work for users needing to send custom
headers in their requests.

Code was inspired by https://github.com/Rob--W/cors-anywhere/blob/70aaa22b3f9ad30c8566024bf25484fd1ed9bda9/lib/cors-anywhere.js#L59-L66
@paulRbr paulRbr self-assigned this Feb 4, 2025
Copy link
Contributor

@hack3rvaillant hack3rvaillant left a comment

Choose a reason for hiding this comment

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

Thank you for taking care of this

@paulRbr paulRbr merged commit 64810d6 into bump-sh:main Feb 4, 2025
1 check 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