node: relax websocket connection header check (#21646)
This makes it accept the "upgrade,keep-alive" header value, which apparently is a thing.
This commit is contained in:
@ -313,7 +313,7 @@ func (h *httpServer) wsAllowed() bool {
|
||||
// isWebsocket checks the header of an http request for a websocket upgrade request.
|
||||
func isWebsocket(r *http.Request) bool {
|
||||
return strings.ToLower(r.Header.Get("Upgrade")) == "websocket" &&
|
||||
strings.ToLower(r.Header.Get("Connection")) == "upgrade"
|
||||
strings.Contains(strings.ToLower(r.Header.Get("Connection")), "upgrade")
|
||||
}
|
||||
|
||||
// NewHTTPHandlerStack returns wrapped http-related handlers
|
||||
|
Reference in New Issue
Block a user