diff options
| author | Sean Liao <sean@liao.dev> | 2024-11-13 18:54:54 +0000 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2024-11-18 16:43:40 +0000 |
| commit | e64f7ef03fdfa1c0d847c21b16c9302cc824e79b (patch) | |
| tree | 36f1346aeaa0c4c64afe176e063179ddb2bf7ef2 /src/net/http/httputil/reverseproxy.go | |
| parent | 5a529e06c153141e7a2508c0b3c3f5f7a631a188 (diff) | |
| download | go-e64f7ef03fdfa1c0d847c21b16c9302cc824e79b.tar.xz | |
net/http/httputil: return after handling error
Fixes #70237
Change-Id: Ieb22b6e7284cb4a40d4987b0e4b9cfb6e5158161
Reviewed-on: https://go-review.googlesource.com/c/go/+/627635
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Diffstat (limited to 'src/net/http/httputil/reverseproxy.go')
| -rw-r--r-- | src/net/http/httputil/reverseproxy.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net/http/httputil/reverseproxy.go b/src/net/http/httputil/reverseproxy.go index 04248d5f53..d64d2fc3a1 100644 --- a/src/net/http/httputil/reverseproxy.go +++ b/src/net/http/httputil/reverseproxy.go @@ -739,6 +739,7 @@ func (p *ReverseProxy) handleUpgradeResponse(rw http.ResponseWriter, req *http.R resUpType := upgradeType(res.Header) if !ascii.IsPrint(resUpType) { // We know reqUpType is ASCII, it's checked by the caller. p.getErrorHandler()(rw, req, fmt.Errorf("backend tried to switch to invalid protocol %q", resUpType)) + return } if !ascii.EqualFold(reqUpType, resUpType) { p.getErrorHandler()(rw, req, fmt.Errorf("backend tried to switch protocol %q when %q was requested", resUpType, reqUpType)) |
