mirror of https://github.com/golang/go.git
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>
This commit is contained in:
parent
b12e341616
commit
b9ecac03cb
|
|
@ -17,6 +17,7 @@ import (
|
|||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
"os"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -748,6 +749,8 @@ func TestServeHTTPDeepCopy(t *testing.T) {
|
|||
// 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 @@ func (cc *checkCloser) Read(b []byte) (int, error) {
|
|||
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue