aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/httputil/reverseproxy_test.go
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@golang.org>2018-07-09 22:29:00 +0000
committerBrad Fitzpatrick <bradfitz@golang.org>2018-07-09 23:40:02 +0000
commiteab57b27f5460a7e6b87fff95ce2948b7812ce05 (patch)
tree4441cdf84997d01472a6ca9de3c2d71dbfca25cf /src/net/http/httputil/reverseproxy_test.go
parent5fbfda6a833f3bbc3d714459b5194f7fef1e0b43 (diff)
downloadgo-eab57b27f5460a7e6b87fff95ce2948b7812ce05.tar.gz
go-eab57b27f5460a7e6b87fff95ce2948b7812ce05.zip
net/http/httputil: don't panic in ReverseProxy unless running under a Server
Prior to the fix to #23643, the ReverseProxy didn't panic with ErrAbortHandler when the copy to a client failed. During Go 1.11 beta testing, we found plenty of code using ReverseProxy in tests that were unprepared for a panic. Change the behavior to only panic when running under the http.Server that'll handle the panic. Updates #23643 Change-Id: Ic1fa8405fd54c858ce8c797cec79d006833a9f7d Reviewed-on: https://go-review.googlesource.com/122819 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/net/http/httputil/reverseproxy_test.go')
-rw-r--r--src/net/http/httputil/reverseproxy_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go
index 0240bfa8a6..2a12e753b5 100644
--- a/src/net/http/httputil/reverseproxy_test.go
+++ b/src/net/http/httputil/reverseproxy_test.go
@@ -29,6 +29,7 @@ import (
const fakeHopHeader = "X-Fake-Hop-Header-For-Test"
func init() {
+ inOurTests = true
hopHeaders = append(hopHeaders, fakeHopHeader)
}