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:
committed by
Colleen Murphy
parent
2c645b3680
commit
e64a94f91c
@@ -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)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user