|
@@ -348,8 +348,8 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if resp.StatusCode != 101 ||
|
|
if resp.StatusCode != 101 ||
|
|
|
- !strings.EqualFold(resp.Header.Get("Upgrade"), "websocket") ||
|
|
|
|
|
- !strings.EqualFold(resp.Header.Get("Connection"), "upgrade") ||
|
|
|
|
|
|
|
+ !tokenListContainsValue(resp.Header, "Upgrade", "websocket") ||
|
|
|
|
|
+ !tokenListContainsValue(resp.Header, "Connection", "upgrade") ||
|
|
|
resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) {
|
|
resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) {
|
|
|
// Before closing the network connection on return from this
|
|
// Before closing the network connection on return from this
|
|
|
// function, slurp up some of the response to aid application
|
|
// function, slurp up some of the response to aid application
|