// an attacker-in-the-middle.
return httpserver.ErrorWithStatus(errors.New("bad X-Arvados-Authorization-Response header"), http.StatusBadGateway)
}
+ resp.Header.Del("X-Arvados-Authorization-Response")
+ for hdr := range resp.Header {
+ // proxy.ServeHTTP adds each
+ // resp.Header to w.Header,
+ // which causes duplicate CORS
+ // and request-id headers,
+ // unless we do this.
+ w.Header().Del(hdr)
+ }
return nil
},
ErrorHandler: func(w http.ResponseWriter, r *http.Request, err error) {
r.Header.Set("X-Webdav-Source", "/log for container "+opts.Path[1:28]+"/")
}
},
+ ModifyResponse: func(resp *http.Response) error {
+ for hdr := range resp.Header {
+ // proxy.ServeHTTP adds each
+ // resp.Header to w.Header, which
+ // causes duplicate CORS and
+ // request-id headers, unless we do
+ // this.
+ w.Header().Del(hdr)
+ }
+ return nil
+ },
}
if conn.cluster.TLS.Insecure {
proxy.Transport = &http.Transport{