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

How to set multiple domains ? #75

Open
vdegenne opened this issue Dec 16, 2020 · 2 comments
Open

How to set multiple domains ? #75

vdegenne opened this issue Dec 16, 2020 · 2 comments

Comments

@vdegenne
Copy link

I tried

app.use(cors({
  origin: function (ctx) {
    if (['https://www.example1.com', 'https://www.example2.com'].includes(ctx.get('Origin'))) {
      return ctx.get('Origin');
    }
    return null;
  }
}));

But it doesn't work, any solution ?

@yeefun
Copy link

yeefun commented Mar 12, 2021

See #52 (comment)

@vdegenne
Copy link
Author

vdegenne commented Mar 12, 2021

@vdegenne weird, my solution is the same as the comment you refer to but It couldn't work in my situation.

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