outposts/proxy: fix duplicate protocol in domain auth mode
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
941bc61b31
commit
c19afa4f16
|
@ -3,6 +3,7 @@ package application
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"goauthentik.io/api"
|
"goauthentik.io/api"
|
||||||
"goauthentik.io/internal/outpost/proxyv2/constants"
|
"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 {
|
if *a.proxyConfig.Mode == api.PROXYMODE_FORWARD_SINGLE {
|
||||||
host = web.GetHost(r)
|
host = web.GetHost(r)
|
||||||
} else if *a.proxyConfig.Mode == api.PROXYMODE_FORWARD_DOMAIN {
|
} 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
|
// 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
|
// to a (possibly) different domain, but we want to be redirected back
|
||||||
|
|
Reference in New Issue