proxy/forward_auth: don't reset forward auth path if X-Forwarded-Uri is not set (#1447)

This commit is contained in:
Manatsawin Hanmongkolchai 2020-09-29 02:28:33 +07:00 committed by GitHub
parent cef1449458
commit a47a3a0be6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -149,7 +149,7 @@ func (p *Proxy) forwardAuthRedirectToSignInWithURI(w http.ResponseWriter, r *htt
// Traefik set the uri in the header, we must set it in redirect uri if present. Otherwise, request like
// https://example.com/foo will be redirected to https://example.com after authentication.
if xfu := r.Header.Get(httputil.HeaderForwardedURI); xfu != "/" {
if xfu := r.Header.Get(httputil.HeaderForwardedURI); xfu != "" && xfu != "/" {
uri.Path = xfu
}