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 issue #13

Open
calumpwebb opened this issue May 8, 2019 · 4 comments
Open

CORS issue #13

calumpwebb opened this issue May 8, 2019 · 4 comments

Comments

@calumpwebb
Copy link

calumpwebb commented May 8, 2019

Hello,

I keep getting

Access to XMLHttpRequest at '{new_host}/v1/batch' from origin '{our domain}' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Any fix for this?

@dhylbert
Copy link

Finding the same issue. Did you ever find solution or workaround? Thanks.

@TidamCo
Copy link

TidamCo commented Oct 16, 2022

You can install the cors dependency : https://github.com/rs/cors

go get github.com/rs/cors

Then add this line juste before que "ListenAndServe"

proxy := cors.Default().Handler(proxy)

@peterlada
Copy link

We are running into this as well, any solution?

@TidamCo
Copy link

TidamCo commented Nov 17, 2022

Actualy, I noticed since then that the proxy already sends the cors headers, and if you try to add your own, you will see multiple occurences of the cors headers, which breaks everything.

The solution is to not alter the response header, and everything works fine.

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