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

Automatic CORS preflight breaks when credentials are used. #44

Open
davidmason opened this issue Jul 6, 2016 · 1 comment
Open

Automatic CORS preflight breaks when credentials are used. #44

davidmason opened this issue Jul 6, 2016 · 1 comment

Comments

@davidmason
Copy link

davidmason commented Jul 6, 2016

Automatic CORS preflight (added in 1.16.0) always returns header 'Access-Control-Allow-Origin': '*'. When using credentials, '*' is not accepted by browsers, and a specific allowed origin is needed instead.

When I define the options endpoint myself and try to return a specific origin, it appears that the automatic preflight takes precedence so the response still has '*'. I can't update above 1.15.0 because of this.

  • If I specify my own options response for an endpoint, that should be used instead of the automatic one.
  • I should be able to turn off the automatic CORS preflight (completely and/or per-endpoint).

EDIT: there are 2 places when the Access-Control-* headers are relevant - OPTIONS request, and in responseHeaders on a GET response. To get CORS with credentials working, I had to make sure I returned the right allowed origin and other access control headers from both of those.

I forget whether I tested overriding the default CORS in both these places at once.

@atropo
Copy link

atropo commented Sep 13, 2017

@davidmason , I got the same problem.
How do you define the options endpoint?

Are you still using < 1.16.0 version?

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

No branches or pull requests

2 participants