mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
5fbfda6a83
commit
eab57b27f5
2 changed files with 28 additions and 1 deletions
|
|
@ -29,6 +29,7 @@ import (
|
|||
const fakeHopHeader = "X-Fake-Hop-Header-For-Test"
|
||||
|
||||
func init() {
|
||||
inOurTests = true
|
||||
hopHeaders = append(hopHeaders, fakeHopHeader)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue