From 2462d5813564471c425190d48aeef5bf3a6295d9 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 27 Sep 2021 20:49:00 +0200 Subject: [PATCH] outposts/proxy: fix duplicate protocol in domain auth mode Signed-off-by: Jens Langhammer --- internal/outpost/proxyv2/application/mode_forward.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/outpost/proxyv2/application/mode_forward.go b/internal/outpost/proxyv2/application/mode_forward.go index 58757bfaa..c5e25cb55 100644 --- a/internal/outpost/proxyv2/application/mode_forward.go +++ b/internal/outpost/proxyv2/application/mode_forward.go @@ -3,6 +3,7 @@ package application import ( "fmt" "net/http" + "net/url" "goauthentik.io/api" "goauthentik.io/internal/outpost/proxyv2/constants" @@ -38,7 +39,8 @@ func (a *Application) forwardHandleTraefik(rw http.ResponseWriter, r *http.Reque if *a.proxyConfig.Mode == api.PROXYMODE_FORWARD_SINGLE { host = web.GetHost(r) } else if *a.proxyConfig.Mode == api.PROXYMODE_FORWARD_DOMAIN { - host = a.proxyConfig.ExternalHost + eh, _ := url.Parse(a.proxyConfig.ExternalHost) + host = eh.Host } // set the redirect flag to the current URL we have, since we redirect // to a (possibly) different domain, but we want to be redirected back