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

[question] Does handler add AllowedOrigins * header by default? #230

Open
harshkolhatkar opened this issue Jun 10, 2022 · 0 comments
Open
Labels

Comments

@harshkolhatkar
Copy link

Describe the problem you're having

A clear and concise description of what the bug is.
The HTTPS server uses handler config something like this without specifying AllowedOrigins,

Handler: handlers.CORS(handlers.AllowedHeaders([]string{header1, header2}),
	handlers.AllowedMethods(allowedMethods))(router)

There is a webserver in front of the backend code which adds a Access-Control-Allow-Origin header. Now I get 2 Access-Control-Allow-Origin headers on the UI, one set by the webserver and the other as access-control-allow-origin: *.
Does handlers add * as a default header if not set? I don't see that in the handlers code, but wanted to still verify.

Versions

Go version: go version
go1.17.10
package version: run git rev-parse HEAD inside the repo
github.com/gorilla/handlers v1.5.1

"Show me the code!"

A minimal code snippet can be useful, otherwise we're left guessing!

Hint: wrap it with backticks to format it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant