-
Notifications
You must be signed in to change notification settings - Fork 11
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
is there a way to add wildcard ports for the origins? #17
Comments
or maybe even domain.tld:80,3000 or domain.tld:80-3000 |
Thanks for the feedback! Unfortunately, the domain = "domain.tld";
ports = [80, 3000];
listener = corser.create({
origins: ports.map(function (p) {
return domain + ":" + p;
})
}); |
instead of the raw req.origin you could parse the hostname out of it, so http://app.test.com:3000 gets app.test.com and then you check the origins array ['app.test.com'] for an indexOf > -1. as an example, what do you think of that idea? like that, the port does not matter anymore, rfc specificly i guess that there should still be a way to not allow a certain port but another one instead, so for that.. it wouldnt work :( |
i have domain.tld or domain.tld:3000 acessing the ressource and i want both to be allowed, but in the origins i would like to specify domain.tld:* or something like that..
The text was updated successfully, but these errors were encountered: