Skip to content

Commit

Permalink
chore: use strings.Contains instead
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Oct 26, 2023
1 parent a96787b commit fa73ae1
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 fa73ae1

Please sign in to comment.