MCPcopy
hub / github.com/gorilla/websocket / IsWebSocketUpgrade

Function IsWebSocketUpgrade

server.go:325–328  ·  server.go::IsWebSocketUpgrade

IsWebSocketUpgrade returns true if the client requested upgrade to the WebSocket protocol.

(r *http.Request)

Source from the content-addressed store, hash-verified

323// IsWebSocketUpgrade returns true if the client requested upgrade to the
324// WebSocket protocol.
325func IsWebSocketUpgrade(r *http.Request) bool {
326 return tokenListContainsValue(r.Header, "Connection", "upgrade") &&
327 tokenListContainsValue(r.Header, "Upgrade", "websocket")
328}
329
330// bufioReaderSize size returns the size of a bufio.Reader.
331func bufioReaderSize(originalReader io.Reader, br *bufio.Reader) int {

Callers 3

TestHostFunction · 0.85
TestNetDialConnectFunction · 0.85
TestIsWebSocketUpgradeFunction · 0.85

Calls 1

tokenListContainsValueFunction · 0.85

Tested by 3

TestHostFunction · 0.68
TestNetDialConnectFunction · 0.68
TestIsWebSocketUpgradeFunction · 0.68