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

Invalid setup: you cannot set origins=* and credentials=true at the same time #2

Open
kxepal opened this issue Aug 23, 2014 · 4 comments

Comments

@kxepal
Copy link

kxepal commented Aug 23, 2014

From CORS specification:

If the resource supports credentials add a single Access-Control-Allow-Origin header, with the value of the Origin header as value, and add a single Access-Control-Allow-Credentials header with the case-sensitive string "true" as value.

Otherwise, add a single Access-Control-Allow-Origin header, with either the value of the Origin header or the string "*" as value.

The string "*" cannot be used for a resource that supports credentials.

This is also noted in CouchDB docs.

@calvinmetcalf
Copy link
Member

How does couch handle setting both of those options and what is the correct
set up?
On Aug 23, 2014 2:21 PM, "Alexander Shorin" notifications@github.com
wrote:

From CORS specification http://www.w3.org/TR/cors/#resource-requests:

If the resource supports credentials add a single
Access-Control-Allow-Origin header, with the value of the Origin header as
value, and add a single Access-Control-Allow-Credentials header with the
case-sensitive string "true" as value.

Otherwise, add a single Access-Control-Allow-Origin header, with either
the value of the Origin header or the string "*" as value.

The string "*" cannot be used for a resource that supports credentials.

This is also noted in CouchDB docs
http://docs.couchdb.org/en/latest/config/http.html#cors/origins.


Reply to this email directly or view it on GitHub
#2.

@kxepal
Copy link
Author

kxepal commented Aug 24, 2014

@calvinmetcalf very easy: in this case CouchDB implicitly sets credentials=false without raising an error or logging that fact.

calvinmetcalf added a commit that referenced this issue Sep 2, 2014
@calvinmetcalf
Copy link
Member

from what you're saying it would sound like setting credentials=true does nothing but #4 seems to imply changing it does have an effect

@kxepal
Copy link
Author

kxepal commented Sep 2, 2014

Yes, it does nothing, but it also doesn't doing what you're expected. That's why it's invalid (;

calvinmetcalf added a commit that referenced this issue Sep 2, 2014
@calvinmetcalf calvinmetcalf mentioned this issue Sep 2, 2014
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