Disable http2 connect setting for websocket by default
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com> Co-authored-by: Julien Salleyron <julien.salleyron@gmail.com> Co-authored-by: Michael <michael.matur@gmail.com>
This commit is contained in:
parent
69c8ecfa99
commit
7cb46626a1
2 changed files with 22 additions and 0 deletions
21
init/init.go
Normal file
21
init/init.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package init
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// This makes use of the GODEBUG flag `http2xconnect` to deactivate the connect setting for HTTP2 by default.
|
||||
// This type of upgrade is yet incompatible with `net/http` http1 reverse proxy.
|
||||
// Please see https://github.com/golang/go/issues/71128#issuecomment-2574193636.
|
||||
func init() {
|
||||
goDebug := os.Getenv("GODEBUG")
|
||||
if strings.Contains(goDebug, "http2xconnect") {
|
||||
return
|
||||
}
|
||||
|
||||
if len(goDebug) > 0 {
|
||||
goDebug += ","
|
||||
}
|
||||
os.Setenv("GODEBUG", goDebug+"http2xconnect=0")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue