avoid double CORS headers in federation (#11334)

CORS proxying adds double headers one
by the receiving server, one by proxied
server. Remove them before proxying
when 'Origin' header is found.
This commit is contained in:
Harshavardhana
2021-01-23 18:27:23 -08:00
committed by GitHub
parent 7575c24037
commit 6a95f412c9
2 changed files with 14 additions and 1 deletions

View File

@@ -17,6 +17,7 @@
package cmd
import (
"context"
"crypto/x509"
"encoding/gob"
"errors"
@@ -61,7 +62,9 @@ func init() {
PassHost: true,
RoundTripper: newGatewayHTTPTransport(1 * time.Hour),
Logger: func(err error) {
logger.LogIf(GlobalContext, err)
if err != nil && !errors.Is(err, context.Canceled) {
logger.LogIf(GlobalContext, err)
}
},
})