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

It says "CORS Enabled" but can't access files from external domains. #249

Open
maboumra opened this issue Dec 7, 2018 · 3 comments
Open

Comments

@maboumra
Copy link

maboumra commented Dec 7, 2018

I really don't know if this is a bug report or a feature request because I don't know what you mean by "CORS Enabled" in the description and I didn't find any reference in the docs. Anyway, it would be nice to have Allow Origin headers automatically added to pages served with Live Server. I know that you can add the flags or install an extension to Chrome but that makes navigation while developing insecure. "Allow Origin" should be added only for the pages you are developing.

Chrome
Live Server 5.3.1

@JonathanWilbur
Copy link

I agree. The use case with Live Server does not warrant Same Origin Policy. CORS should be enabled.

@larryhu
Copy link

larryhu commented May 31, 2019

I found a way to fix this problem so far (even though it looks like so bad), adding below config to your settings.json .

{
    "liveServer.settings.proxy": {
        "enable": true,
        "baseUri": "/api", 
        "proxyUri": "http://127.0.0.1:8080/"
    }
}

@flyingduck92
Copy link

Hey I have the same issue when using d3.js. How to fix this issue?

d3.html('http://enable-cors.org')
  .get((err, data) => {
    console.log(data)
  })

image

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

4 participants