From fa73ae168d7cd4fcecc9cd5660cf59ebd5f81625 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Thu, 26 Oct 2023 20:18:20 +0800 Subject: [PATCH] chore: use strings.Contains instead --- server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.go b/server.go index 63d1bf7..af332da 100644 --- a/server.go +++ b/server.go @@ -533,7 +533,7 @@ type LogJson struct { // check request is the websocket request // check Connection contains upgrade func checkIsWebSocketRequest(req *http.Request) bool { - if strings.Index(strings.ToLower(req.Header.Get("Connection")), "upgrade") >= 0 { + if strings.Contains(strings.ToLower(req.Header.Get("Connection")), "upgrade") { return true } return false