From a47a3a0be6e1e42f35b26ecdb32048376f49ed87 Mon Sep 17 00:00:00 2001 From: Manatsawin Hanmongkolchai Date: Tue, 29 Sep 2020 02:28:33 +0700 Subject: [PATCH] proxy/forward_auth: don't reset forward auth path if X-Forwarded-Uri is not set (#1447) --- proxy/forward_auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/forward_auth.go b/proxy/forward_auth.go index 0d55a118f..03aad001f 100644 --- a/proxy/forward_auth.go +++ b/proxy/forward_auth.go @@ -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 }