1
0
Fork 0

Forward all header values from forward auth response

This commit is contained in:
ctas582 2019-04-10 16:18:06 +01:00 committed by Traefiker Bot
parent d356ef1c5b
commit 3d7633f4a6
2 changed files with 10 additions and 2 deletions

View file

@ -147,7 +147,11 @@ func (fa *forwardAuth) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
}
for _, headerName := range fa.authResponseHeaders {
req.Header.Set(headerName, forwardResponse.Header.Get(headerName))
headerKey := http.CanonicalHeaderKey(headerName)
req.Header.Del(headerKey)
if len(forwardResponse.Header[headerKey]) > 0 {
req.Header[headerKey] = append([]string(nil), forwardResponse.Header[headerKey]...)
}
}
req.RequestURI = req.URL.RequestURI()