-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add vary: origin
header when origin is "*"
#45
Conversation
…der varies depending on `origin` req header
Hey @balexand, there are a couple of things to consider here.
As you can see, it clearly says that if the resource supports credentials, you shouldn't set |
Hi @whatyouhide. Thanks for your thoughtful response and I agree with all of your points. Based on your response I'm confused as to why you closed this without merging it.
This is true, the CORS spec agrees with this, and MDN also explains that this is important. Yet Corsica is not following this advice and this pull-request fixes that. Your 2nd and 3rd points are unrelated to the content of this pull-request. This pull-request doesn't change the value sent for the If you're not satisfied with the fix that I implemented here then I would be happy to open an issue so at least this bug can be documented. Thanks for you work on this library! 💛 |
Oh, I was absolutely confused and also wrong 😄 This all makes sense. Thanks a lot for the contribution and great catch! 💟 |
Release v1.1.3, thanks! |
Thank you so much! I've really appreciated using both Corsica and Redix. 😄 |
I ran into a bug with a caching proxy with the following configuration:
The response header
access-control-allow-origin
was being set to the actual origin due to this code:corsica/lib/corsica.ex
Lines 579 to 586 in 02fd930
This meant that the
access-control-allow-origin
response header varied depending on theorigin
request header. But thevary: origin
response header wasn't being set. This pull-request fixes this.