From 781a767fb6f070d3a9d70c7aca9d247703cb8a4b Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 15 Sep 2022 09:54:36 +1000 Subject: [PATCH] Fix https detection with reverse proxy (#2910) --- internal/api/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/api/server.go b/internal/api/server.go index 1029fb8a7..5a3719c24 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -407,7 +407,7 @@ func BaseURLMiddleware(next http.Handler) http.Handler { ctx := r.Context() scheme := "http" - if r.TLS != nil { + if strings.Compare("https", r.URL.Scheme) == 0 || r.TLS != nil || r.Header.Get("X-Forwarded-Proto") == "https" { scheme = "https" } prefix := getProxyPrefix(r.Header)