We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 096ce41 commit e075bf4Copy full SHA for e075bf4
context.go
@@ -153,7 +153,8 @@ func (c *Context) IsTLS() bool {
153
// IsWebSocket returns true if HTTP connection is WebSocket otherwise false.
154
func (c *Context) IsWebSocket() bool {
155
upgrade := c.request.Header.Get(HeaderUpgrade)
156
- return strings.EqualFold(upgrade, "websocket")
+ connection := c.request.Header.Get(HeaderConnection)
157
+ return strings.EqualFold(upgrade, "websocket") && strings.Contains(strings.ToLower(connection), "upgrade")
158
}
159
160
// Scheme returns the HTTP protocol scheme, `http` or `https`.
0 commit comments