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 Error due to lowercase #167

Open
Hobart2967 opened this issue Feb 4, 2021 · 4 comments
Open

CORS Error due to lowercase #167

Hobart2967 opened this issue Feb 4, 2021 · 4 comments

Comments

@Hobart2967
Copy link

Hobart2967 commented Feb 4, 2021

Firefox will not recognize cors headers due to them being lowercased:

let _key = key.toLowerCase() // store as lowercase

Removing the "toLowerCase" fixes the issue.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://url.com/bla. (Reason: header ‘sentry-trace’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response).

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://url.com/bla. (Reason: CORS request did not succeed).
Hobart2967 pushed a commit to Hobart2967/lambda-api that referenced this issue Feb 4, 2021
@Hobart2967 Hobart2967 mentioned this issue Feb 4, 2021
@Hobart2967
Copy link
Author

Added PR for this issue

@jeremydaly
Copy link
Owner

Hi @Hobart2967. Lowercasing was done to be compatible with HTTP/2 and the change that Chrome made in version 60. See more here: elm/http#31

I haven't looked into the status of the RFC or whether or not this has been reverted, but we can't just turn this off since it would break a number of existing applications. If you can share any updated research on this, then we can figure out a workaround that is backwards compatible.

@Hobart2967
Copy link
Author

Got ya, but on the other hand you're dropping browser support. Will adjust the PR to make it configurable

@Hobart2967
Copy link
Author

Hobart2967 commented Feb 8, 2021

See here: #169

I added a configuration entry headerStyle that applies the non-compliant header styles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants