From 9138b2b50305c023414a1e557a87916e1f3855f1 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Fri, 7 Aug 2020 12:10:16 +0100 Subject: [PATCH] Avoid duplicate headers when proxying S3 listing requests (#10220) --- cmd/handler-utils.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/handler-utils.go b/cmd/handler-utils.go index 228353344..f470799b0 100644 --- a/cmd/handler-utils.go +++ b/cmd/handler-utils.go @@ -480,6 +480,12 @@ func getHostName(r *http.Request) (hostName string) { func proxyRequest(ctx context.Context, w http.ResponseWriter, r *http.Request, ep ProxyEndpoint) (success bool) { success = true + // Make sure we remove any existing headers before + // proxying the request to another node. + for k := range w.Header() { + w.Header().Del(k) + } + f := handlers.NewForwarder(&handlers.Forwarder{ PassHost: true, RoundTripper: ep.Transport,