mirror of
https://github.com/rancher/steve.git
synced 2025-09-14 22:39:20 +00:00
Merge pull request #25 from cmurphy/impersonation
[v2.5] Strip impersonation headers prior to proxy call
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user