diff options
author | 2024-06-10 07:43:38 +0000 | |
---|---|---|
committer | 2024-06-10 07:43:38 +0000 | |
commit | a687f0634c48f5cdcc878a4b390a955d5d0cd9ad (patch) | |
tree | 8d2e4e7d0aca496781968b46b7aa5afb1dee71e9 /vendor/github.com/gorilla/websocket/proxy.go | |
parent | [chore]: Bump github.com/tdewolff/minify/v2 from 2.20.32 to 2.20.33 (#2984) (diff) | |
download | gotosocial-a687f0634c48f5cdcc878a4b390a955d5d0cd9ad.tar.xz |
[chore]: Bump github.com/gorilla/websocket from 1.5.1 to 1.5.2 (#2987)
Bumps [github.com/gorilla/websocket](https://github.com/gorilla/websocket) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/gorilla/websocket/releases)
- [Commits](https://github.com/gorilla/websocket/compare/v1.5.1...v1.5.2)
---
updated-dependencies:
- dependency-name: github.com/gorilla/websocket
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/gorilla/websocket/proxy.go')
-rw-r--r-- | vendor/github.com/gorilla/websocket/proxy.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/vendor/github.com/gorilla/websocket/proxy.go b/vendor/github.com/gorilla/websocket/proxy.go index 80f55d1ea..3c570c26f 100644 --- a/vendor/github.com/gorilla/websocket/proxy.go +++ b/vendor/github.com/gorilla/websocket/proxy.go @@ -8,7 +8,6 @@ import ( "bufio" "encoding/base64" "errors" - "log" "net" "net/http" "net/url" @@ -58,9 +57,7 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) } if err := connectReq.Write(conn); err != nil { - if err := conn.Close(); err != nil { - log.Printf("httpProxyDialer: failed to close connection: %v", err) - } + conn.Close() return nil, err } @@ -69,16 +66,12 @@ func (hpd *httpProxyDialer) Dial(network string, addr string) (net.Conn, error) br := bufio.NewReader(conn) resp, err := http.ReadResponse(br, connectReq) if err != nil { - if err := conn.Close(); err != nil { - log.Printf("httpProxyDialer: failed to close connection: %v", err) - } + conn.Close() return nil, err } - if resp.StatusCode != 200 { - if err := conn.Close(); err != nil { - log.Printf("httpProxyDialer: failed to close connection: %v", err) - } + if resp.StatusCode != http.StatusOK { + conn.Close() f := strings.SplitN(resp.Status, " ", 2) return nil, errors.New(f[1]) } |