mirror of
https://github.com/stashapp/stash.git
synced 2025-12-08 01:13:09 +01:00
Disable http2 and fix https detection (#2900)
This commit is contained in:
parent
2368269e63
commit
df9c7594c7
1 changed files with 7 additions and 4 deletions
|
|
@ -278,6 +278,11 @@ func Start() error {
|
|||
Addr: address,
|
||||
Handler: r,
|
||||
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()
|
||||
|
|
@ -401,11 +406,9 @@ func BaseURLMiddleware(next http.Handler) http.Handler {
|
|||
fn := func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
var scheme string
|
||||
if strings.Compare("https", r.URL.Scheme) == 0 || r.Proto == "HTTP/2.0" || r.Header.Get("X-Forwarded-Proto") == "https" {
|
||||
scheme := "http"
|
||||
if r.TLS != nil {
|
||||
scheme = "https"
|
||||
} else {
|
||||
scheme = "http"
|
||||
}
|
||||
prefix := getProxyPrefix(r.Header)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue