summaryrefslogtreecommitdiff
path: root/vendor/github.com/gorilla/websocket/client.go
diff options
context:
space:
mode:
authorLibravatar Daenney <daenney@users.noreply.github.com>2024-11-25 11:50:03 +0100
committerLibravatar GitHub <noreply@github.com>2024-11-25 10:50:03 +0000
commit2ed409888b988115433b5eddb62ca38c00c68325 (patch)
tree2196f46b63191bc79b9dab096ac52e5db877a24f /vendor/github.com/gorilla/websocket/client.go
parent[chore]: Bump github.com/tdewolff/minify/v2 from 2.21.1 to 2.21.2 (#3567) (diff)
downloadgotosocial-2ed409888b988115433b5eddb62ca38c00c68325.tar.xz
[chore] Update gorilla/websocket (#3561)
The maintainers messed with the v1.5.2 tag which causes Go checksum validation problems as the Go module proxy saw and recorded the original hash. This updates to 1.5.3 which doesn't have the issue.
Diffstat (limited to 'vendor/github.com/gorilla/websocket/client.go')
-rw-r--r--vendor/github.com/gorilla/websocket/client.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/vendor/github.com/gorilla/websocket/client.go b/vendor/github.com/gorilla/websocket/client.go
index 7023e1176..04fdafee1 100644
--- a/vendor/github.com/gorilla/websocket/client.go
+++ b/vendor/github.com/gorilla/websocket/client.go
@@ -11,14 +11,13 @@ import (
"errors"
"fmt"
"io"
+ "io/ioutil"
"net"
"net/http"
"net/http/httptrace"
"net/url"
"strings"
"time"
-
- "golang.org/x/net/proxy"
)
// ErrBadHandshake is returned when the server response to opening handshake is
@@ -305,7 +304,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
return nil, nil, err
}
if proxyURL != nil {
- dialer, err := proxy.FromURL(proxyURL, netDialerFunc(netDial))
+ dialer, err := proxy_FromURL(proxyURL, netDialerFunc(netDial))
if err != nil {
return nil, nil, err
}
@@ -392,7 +391,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
}
}
- if resp.StatusCode != http.StatusSwitchingProtocols ||
+ if resp.StatusCode != 101 ||
!tokenListContainsValue(resp.Header, "Upgrade", "websocket") ||
!tokenListContainsValue(resp.Header, "Connection", "upgrade") ||
resp.Header.Get("Sec-Websocket-Accept") != computeAcceptKey(challengeKey) {
@@ -401,7 +400,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
// debugging.
buf := make([]byte, 1024)
n, _ := io.ReadFull(resp.Body, buf)
- resp.Body = io.NopCloser(bytes.NewReader(buf[:n]))
+ resp.Body = ioutil.NopCloser(bytes.NewReader(buf[:n]))
return nil, resp, ErrBadHandshake
}
@@ -419,7 +418,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
break
}
- resp.Body = io.NopCloser(bytes.NewReader([]byte{}))
+ resp.Body = ioutil.NopCloser(bytes.NewReader([]byte{}))
conn.subprotocol = resp.Header.Get("Sec-Websocket-Protocol")
netConn.SetDeadline(time.Time{})
@@ -429,7 +428,7 @@ func (d *Dialer) DialContext(ctx context.Context, urlStr string, requestHeader h
func cloneTLSConfig(cfg *tls.Config) *tls.Config {
if cfg == nil {
- return &tls.Config{MinVersion: tls.VersionTLS12}
+ return &tls.Config{}
}
return cfg.Clone()
}