]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: don't panic in ReverseProxy unless running under a Server
authorBrad Fitzpatrick <bradfitz@golang.org>
Mon, 9 Jul 2018 22:29:00 +0000 (22:29 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 9 Jul 2018 23:40:02 +0000 (23:40 +0000)
commiteab57b27f5460a7e6b87fff95ce2948b7812ce05
tree4441cdf84997d01472a6ca9de3c2d71dbfca25cf
parent5fbfda6a833f3bbc3d714459b5194f7fef1e0b43
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>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go