outposts/proxy: copy user-agent header from upstream request
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
e917e756cc
commit
e42ad8db93
|
@ -27,6 +27,7 @@ func (a *Application) forwardHandleTraefik(rw http.ResponseWriter, r *http.Reque
|
||||||
claims, err := a.getClaims(r)
|
claims, err := a.getClaims(r)
|
||||||
if claims != nil && err == nil {
|
if claims != nil && err == nil {
|
||||||
a.addHeaders(rw.Header(), claims)
|
a.addHeaders(rw.Header(), claims)
|
||||||
|
rw.Header().Set("User-Agent", r.Header.Get("User-Agent"))
|
||||||
a.log.WithField("headers", rw.Header()).Trace("headers written to forward_auth")
|
a.log.WithField("headers", rw.Header()).Trace("headers written to forward_auth")
|
||||||
return
|
return
|
||||||
} else if claims == nil && a.IsAllowlisted(r) {
|
} else if claims == nil && a.IsAllowlisted(r) {
|
||||||
|
@ -70,6 +71,7 @@ func (a *Application) forwardHandleNginx(rw http.ResponseWriter, r *http.Request
|
||||||
claims, err := a.getClaims(r)
|
claims, err := a.getClaims(r)
|
||||||
if claims != nil && err == nil {
|
if claims != nil && err == nil {
|
||||||
a.addHeaders(rw.Header(), claims)
|
a.addHeaders(rw.Header(), claims)
|
||||||
|
rw.Header().Set("User-Agent", r.Header.Get("User-Agent"))
|
||||||
rw.WriteHeader(200)
|
rw.WriteHeader(200)
|
||||||
a.log.WithField("headers", rw.Header()).Trace("headers written to forward_auth")
|
a.log.WithField("headers", rw.Header()).Trace("headers written to forward_auth")
|
||||||
return
|
return
|
||||||
|
|
Reference in New Issue