mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Fix scheme detection when reverse proxy is used
This commit is contained in:
@@ -222,7 +222,7 @@ func BaseURLMiddleware(next http.Handler) http.Handler {
|
|||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
|
|
||||||
var scheme string
|
var scheme string
|
||||||
if strings.Compare("https", r.URL.Scheme) == 0 || r.Proto == "HTTP/2.0" {
|
if strings.Compare("https", r.URL.Scheme) == 0 || r.Proto == "HTTP/2.0" || r.Header.Get("X-Forwarded-Proto") == "https" {
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
} else {
|
} else {
|
||||||
scheme = "http"
|
scheme = "http"
|
||||||
|
|||||||
Reference in New Issue
Block a user