Fix https detection with reverse proxy (#2910)

This commit is contained in:
WithoutPants
2022-09-15 09:54:36 +10:00
committed by GitHub
parent d558902dfb
commit 781a767fb6

View File

@@ -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)