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

Minor README.md documentation issue/clarification. #28

Open
mortizbey opened this issue Sep 14, 2014 · 2 comments
Open

Minor README.md documentation issue/clarification. #28

mortizbey opened this issue Sep 14, 2014 · 2 comments

Comments

@mortizbey
Copy link

Hi, there's a section in the Readme that says:

Note that you can always send back '' instead of echoing the 'Origin' header by including:

cors.headers = ['Access-Control-Allow-Origin': '*']

This can be combined with cors.allow.origin.regex to limit allowed domains.

That last sentence is kind of confusing since I don't know, from the context, what are you referring to by "combining with allow origin regex to limit allowed domains". Wouldn't setting the cors.allow.origin.regex property be enough since it would cancel out the * in the Access-Control-Allow-Origin?

Can you clarify this a little? Then I can fork the documentation and fix that part if you want to.

Thanks!

@mortizbey
Copy link
Author

Any answer to this? It has been a year now.

@davidtinker
Copy link
Owner

If cors.allow.origin.regex is set then CORS headers are only sent back for origins that match the regex. So using a star for the Access-Control-Allow-Origin is ok because you aren't relying on the browser to check for valid domains.

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