Skip to content

Commit

Permalink
Merge pull request #253 from testwill/string
Browse files Browse the repository at this point in the history
chore: use strings.Contains instead
  • Loading branch information
devfeel authored Dec 13, 2023
2 parents 53f13a9 + fa73ae1 commit 2fe667e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2fe667e

Please sign in to comment.