-
-
Notifications
You must be signed in to change notification settings - Fork 474
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
allow 'options.origin' to be a regexp #42
Comments
@zaggino that's a good idea. I suggest to also add an option to assign an array to origin to support an origin whitelist. Supporting regex and array will mean that you hardly never need to use the function syntax (the only reason to use it will be for complex scenarios). @troygoode, what do you think? |
Are we able to get this feature documented? |
Since this issue comes up high in google search results and the actual documentation doesn't, yes. It was documented. |
usage would be:
options.origin = /^(.*\.)?github\.com$/
to allow cors from any subdomain ofgithub.com
implementation probably something like
https://github.com/troygoode/node-cors/blob/master/lib/index.js#L25
The text was updated successfully, but these errors were encountered: