net/http/httputil: reduced log verbosity in reverseproxy_test.go
For functions TestClonesRequestHeaders and TestReverseProxy_PanicBodyError,
I made changes to update the log verbosity.
Fixes #25634
Change-Id: I2a0ef70a8191cfb1a0005949345be722fb4ab62e
Reviewed-on: https://go-review.googlesource.com/115296
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
diff --git a/src/net/http/httputil/reverseproxy_test.go b/src/net/http/httputil/reverseproxy_test.go
index 1ad6756..0240bfa 100644
--- a/src/net/http/httputil/reverseproxy_test.go
+++ b/src/net/http/httputil/reverseproxy_test.go
@@ -17,6 +17,7 @@
"net/http"
"net/http/httptest"
"net/url"
+ "os"
"reflect"
"strconv"
"strings"
@@ -748,6 +749,8 @@
// Issue 18327: verify we always do a deep copy of the Request.Header map
// before any mutations.
func TestClonesRequestHeaders(t *testing.T) {
+ log.SetOutput(ioutil.Discard)
+ defer log.SetOutput(os.Stderr)
req, _ := http.NewRequest("GET", "http://foo.tld/", nil)
req.RemoteAddr = "1.2.3.4:56789"
rp := &ReverseProxy{
@@ -824,6 +827,8 @@
// Issue 23643: panic on body copy error
func TestReverseProxy_PanicBodyError(t *testing.T) {
+ log.SetOutput(ioutil.Discard)
+ defer log.SetOutput(os.Stderr)
backendServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
out := "this call was relayed by the reverse proxy"
// Coerce a wrong content length to induce io.ErrUnexpectedEOF