all: use strings.EqualFold for string comparison (#24890)
This commit is contained in:
+1
-1
@@ -357,7 +357,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" &&
|
||||
return strings.EqualFold(r.Header.Get("Upgrade"), "websocket") &&
|
||||
strings.Contains(strings.ToLower(r.Header.Get("Connection")), "upgrade")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user