Closed santosh closed 2 years ago
Access-Control-Allow-Origin
(ACAO, for short) never belongs in a request, as it is a response header. Therefore, you should never need to list that header name in the Access-Control-Allow-Headers
. Clients who add the ACAO header to their requests are misguided, and can safely stop doing so.
Actually you are correct. I'm taking this PR back. Thanks for pointing out.
But when I made the change, it worked for some reason. Thanks anyways.
When client sends Access-Control-Allow-Origin, server must respond with the same domain(s). If not done, preflight response fails.
With this change,
AllowHeaders
slice hasAccess-Control-Allow-Origin
present, which does nod need any additional configuration and works out of the box oncors.Default()
.This is a fix to #84.