mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Disable http2 and fix https detection (#2900)
This commit is contained in:
@@ -278,6 +278,11 @@ func Start() error {
|
|||||||
Addr: address,
|
Addr: address,
|
||||||
Handler: r,
|
Handler: r,
|
||||||
TLSConfig: tlsConfig,
|
TLSConfig: tlsConfig,
|
||||||
|
// disable http/2 support by default
|
||||||
|
// when http/2 is enabled, we are unable to hijack and close
|
||||||
|
// the connection/request. This is necessary to stop running
|
||||||
|
// streams when deleting a scene file.
|
||||||
|
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)),
|
||||||
}
|
}
|
||||||
|
|
||||||
printVersion()
|
printVersion()
|
||||||
@@ -401,11 +406,9 @@ func BaseURLMiddleware(next http.Handler) http.Handler {
|
|||||||
fn := func(w http.ResponseWriter, r *http.Request) {
|
fn := func(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
|
|
||||||
var scheme string
|
scheme := "http"
|
||||||
if strings.Compare("https", r.URL.Scheme) == 0 || r.Proto == "HTTP/2.0" || r.Header.Get("X-Forwarded-Proto") == "https" {
|
if r.TLS != nil {
|
||||||
scheme = "https"
|
scheme = "https"
|
||||||
} else {
|
|
||||||
scheme = "http"
|
|
||||||
}
|
}
|
||||||
prefix := getProxyPrefix(r.Header)
|
prefix := getProxyPrefix(r.Header)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user