Closed jney closed 3 years ago
A hacky way to fix this is doing this:
ModifyResponse: cors.New(cors.Config{AllowCredentials: true})
I tested your example, and it seems to work well for me. I'm closing this issue, feel free to re-open 👍
@K0enM @Fenny Looks like I have the same issue. Do you have an example using the proxy.Do function?
@K0enM @Fenny Looks like I have the same issue. Do you have an example using the proxy.Do function?
Just found a way. This is example when you use proxy.Do:
err = proxy.Do(c, "http://localhost")
if err != nil {
return err
}
c.Response().Header.Set("Access-Control-Allow-Origin", "http://host.com")
c.Response().Header.Set("Access-Control-Allow-Credentials", "true")
return nil
@pejeio Can you open a new issue, so that we can look at it. Thanks!
My guess is the Proxy middleware is removing the headers.
Is there any development here to not remove those header during proxy?
Fiber version
v2.2.0
Issue description
cors headers not added using both middlewares proxy and cors
Code snippet