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

Merge pull request #25 from cmurphy/impersonation

[v2.5] Strip impersonation headers prior to proxy call
This commit is contained in:
Caleb Bron
2021-08-23 14:13:06 -07:00
committed by GitHub

View File

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