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:
1 parent
716864deba
commit
015e78928a
2 files changed
+16
-1
No files matched your search
+1
-1
@@ -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