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

Is it possible to declare multiple origins to allow? #39

Open
PanicIsReal opened this issue May 29, 2016 · 1 comment
Open

Is it possible to declare multiple origins to allow? #39

PanicIsReal opened this issue May 29, 2016 · 1 comment

Comments

@PanicIsReal
Copy link

The option says origin expects a string, is it possible to allow an array of strings so you can allow more than one domain?

@ahauser31
Copy link

I might be mistaken, but from what I gathered from the spec is that multiple domains are not supported ( https://www.w3.org/TR/cors/#access-control-allow-credentials-response-header ).
To use multiple origins with this middleware, use the feature to pass a function in options.origin that compares the origin of the request (this.get('origin') in Koa 1) with your array and echos back the request origin if it is on your list.

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