Skip to content

Commit

Permalink
checkIsWebSocketRequest update
Browse files Browse the repository at this point in the history
  • Loading branch information
devfeel committed May 10, 2017
1 parent d704a64 commit 9dd2ca9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,9 @@ func logRequest(req *http.Request, timetaken int64) string {
}

//check request is the websocket request
//check Connection contains upgrade
func checkIsWebSocketRequest(req *http.Request) bool {
if req.Header.Get("Connection") == "Upgrade" {
if strings.Index(strings.ToLower(req.Header.Get("Connection")), "upgrade") >= 0 {
return true
}
return false
Expand Down

0 comments on commit 9dd2ca9

Please sign in to comment.