1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-13 05:49:16 +00:00

Strip impersonation headers prior to proxy call

(cherry picked from commit bb76e4db56)
This commit is contained in:
Darren Shepherd
2021-08-04 14:57:42 -07:00
committed by Colleen Murphy
parent 2c645b3680
commit e64a94f91c

View File

@@ -79,6 +79,12 @@ func impersonate(rw http.ResponseWriter, req *http.Request, prefix string, cfg *
return return
} }
req = req.Clone(req.Context())
for k := range req.Header {
if strings.HasPrefix(k, "Impersonate-") {
delete(req.Header, k)
}
}
handler.ServeHTTP(rw, req) handler.ServeHTTP(rw, req)
} }