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

Whitelisting subdomain doesn't work as expected #474

Open
sibsfinx opened this issue Nov 27, 2023 · 0 comments
Open

Whitelisting subdomain doesn't work as expected #474

sibsfinx opened this issue Nov 27, 2023 · 0 comments

Comments

@sibsfinx
Copy link

sibsfinx commented Nov 27, 2023

I'm running cors-anywhere via pm2:

CORSANYWHERE_WHITELIST=https://www.test.mydomain.com/,https://www.mydomain.com/ PORT=8080 pm2 start server.js --name cors-anywhere

when trying to reach it from a subdomain, I get 403:

const r = await fetch("https://cors.mydomain.com/https://some-iframe-url.io/", {
  "headers": {
      "origin": "https://www.test.mydomain.com/",
  }
});

// fails with 403
// The origin "https://www.gamma.vectary.com" was not whitelisted by the operator of this proxy.

But when doing the same from a 2nd level domain, it's all good

const r = await fetch("https://cors.mydomain.com/https://some-iframe-url.io/", {
  "headers": {
      "origin": "https://www.mydomain.com/",
  }
});

// 200 OK

Am I missing anything?

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

1 participant