diff --git a/consts.go b/consts.go index 06f13ca..1a6f70b 100644 --- a/consts.go +++ b/consts.go @@ -3,7 +3,7 @@ package dotweb // Global define const ( // Version current version - Version = "1.7.21" + Version = "1.7.22" ) // Log define 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 diff --git a/version.MD b/version.MD index a1d1bdf..6270a24 100644 --- a/version.MD +++ b/version.MD @@ -1,5 +1,10 @@ ## dotweb版本记录: +####Version 1.7.22 +* tip: use strings.Contains instead strings.Index on server.go +* Thanks for @testwill #253! +* 2023-12-13 08:00 at ShangHai + ####Version 1.7.21 * feature: add SessionManager.RemoveSessionState to delete the session state associated with a specific session ID * feature: add HttpContext.DestorySession() to delete all contents of the session and set the sessionId to empty