mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-07 20:08:17 +02:00
proxy/forward_auth: copy response headers as request headers (#1577)
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
parent
ccdd1e5586
commit
d1bab414c5
1 changed files with 7 additions and 0 deletions
|
@ -103,6 +103,13 @@ func (p *Proxy) allowUpstream(w http.ResponseWriter, r *http.Request) error {
|
|||
if status := r.FormValue("auth_status"); status == fmt.Sprint(http.StatusForbidden) {
|
||||
return httputil.NewError(http.StatusForbidden, errors.New(http.StatusText(http.StatusForbidden)))
|
||||
}
|
||||
// in forward-auth configuration we want to treat our request headers as response headers
|
||||
// so that they can be forwarded by the fronting proxy, if desired
|
||||
for k, vs := range r.Header {
|
||||
for _, v := range vs {
|
||||
w.Header().Set(k, v)
|
||||
}
|
||||
}
|
||||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue