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

Use Flask-CORS for more robust CORS configuration. #1121

Merged
merged 1 commit into from
Aug 12, 2015

Conversation

jmcarp
Copy link
Contributor

@jmcarp jmcarp commented Aug 12, 2015

The API currently uses the Access-Control-Allow-Origin header, but not
the Access-Control-Allow-Headers header. This leads to CORS errors
when using Safari, which sends the Accept-Encoding header with its
OPTIONS requests. Rather than allowing the Accept-Encoding header,
this patch switches to Flask-CORS for CORS configuration, which has
better defaults and is easier to configure than settings CORS headers
manually.

Thanks @onezerojeremy and @noahmanger for help with debugging.

[Resolves https://github.com/fecgov/openFEC-web-app/issues/462]

The API currently uses the `Access-Control-Allow-Origin` header, but not
the `Access-Control-Allow-Headers` header. This leads to CORS errors
when using Safari, which sends the `Accept-Encoding` header with its
`OPTIONS` requests. Rather than allowing the `Accept-Encoding` header,
this patch switches to Flask-CORS for CORS configuration, which has
better defaults and is easier to configure than settings CORS headers
manually.

[Resolves fecgov/openFEC-web-app#462]
@LindsayYoung
Copy link
Contributor

Thanks for figuring this out!

LindsayYoung added a commit that referenced this pull request Aug 12, 2015
Use Flask-CORS for more robust CORS configuration.
@LindsayYoung LindsayYoung merged commit eb7ec99 into fecgov:develop Aug 12, 2015
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.

None yet

2 participants