Skip to content

Commit e64f7ef

Browse files
seankhliaogopherbot
authored andcommitted
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 <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> Reviewed-by: Damien Neil <[email protected]>
1 parent 5a529e0 commit e64f7ef

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/net/http/httputil/reverseproxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ func (p *ReverseProxy) handleUpgradeResponse(rw http.ResponseWriter, req *http.R
739739
resUpType := upgradeType(res.Header)
740740
if !ascii.IsPrint(resUpType) { // We know reqUpType is ASCII, it's checked by the caller.
741741
p.getErrorHandler()(rw, req, fmt.Errorf("backend tried to switch to invalid protocol %q", resUpType))
742+
return
742743
}
743744
if !ascii.EqualFold(reqUpType, resUpType) {
744745
p.getErrorHandler()(rw, req, fmt.Errorf("backend tried to switch protocol %q when %q was requested", resUpType, reqUpType))

0 commit comments

Comments
 (0)