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

CORS 404 OPTIONS #199

Open
totszwai opened this issue Aug 4, 2021 · 2 comments
Open

CORS 404 OPTIONS #199

totszwai opened this issue Aug 4, 2021 · 2 comments

Comments

@totszwai
Copy link

totszwai commented Aug 4, 2021

Environment

  • lite-server version: 2.6.1
  • nodejs version: 10.24.1
  • npm version: 6.14.12
  • OS type/version: MacOS
  • bs-config.json:
{
  "cors": true,
  "injectChanges": true,
  "logLevel": "debug",
  "open": false
}

When trying to proxy an html file, I am getting this error in the browser:

Access to fetch at 'https://d1c50u1zbkqmph.cloudfront.net/monitoring/security/template.html' from origin 'https://app-blah.somedomain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Then in the lite-server side, it logged:

21.08.04 12:58:06 404 OPTIONS /monitoring/security/template.html

What do I need to do to get this to work? It works for other files such as json but not with html? json files used to failed too, but after I turned on cors: true then it worked for json but doesn't seems to be the case for html.

@totszwai
Copy link
Author

Anyone else facing this issue? Anyone has a workaround or special config I need to use?

@madhawa-se
Copy link

I'm having the same issue

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