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

allow all origins wildcard not supported by chrome #17

Open
cameronbraid opened this issue May 12, 2021 · 3 comments
Open

allow all origins wildcard not supported by chrome #17

cameronbraid opened this issue May 12, 2021 · 3 comments

Comments

@cameronbraid
Copy link

Am getting an error in chrome dev tools :

Access to CSS stylesheet at 'https://..' from origin 'https://...' has been blocked by CORS policy:
 The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard
  '*' when the request's credentials mode is 'include'.
16:11:31.942

How should I handle this to make go-chi write the request origin header instead ?

@cameronbraid
Copy link
Author

I found a workaround

use AllowedOrigins=["https://*","http://*"] and AllowCredentials=true

@iamajoe
Copy link

iamajoe commented Mar 25, 2023

Should the library default URLs without a protocol to contain on the []slice a version with http and a version with https?
Probably not, it would introduce a bit of "magic" and maybe the developer should know that he needs to set them. If so, should this be documented on the documentation? Should an error be thrown in case the developer doesn't set the protocols?

I can work on this upon decisions.

@jub0bs
Copy link

jub0bs commented Dec 15, 2023

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

3 participants