diff options
Diffstat (limited to 'libgo/go/net/http/client_test.go')
-rw-r--r-- | libgo/go/net/http/client_test.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libgo/go/net/http/client_test.go b/libgo/go/net/http/client_test.go index 1c59ce74352..de490bc6074 100644 --- a/libgo/go/net/http/client_test.go +++ b/libgo/go/net/http/client_test.go @@ -317,8 +317,7 @@ func TestClientRedirectContext(t *testing.T) { return errors.New("redirected request's context never expired after root request canceled") } } - req, _ := NewRequest("GET", ts.URL, nil) - req = req.WithContext(ctx) + req, _ := NewRequestWithContext(ctx, "GET", ts.URL, nil) _, err := c.Do(req) ue, ok := err.(*url.Error) if !ok { @@ -1185,6 +1184,11 @@ func TestStripPasswordFromError(t *testing.T) { in: "http://user:password@dummy.faketld/password", out: "Get http://user:***@dummy.faketld/password: dummy impl", }, + { + desc: "Strip escaped password", + in: "http://user:pa%2Fssword@dummy.faketld/", + out: "Get http://user:***@dummy.faketld/: dummy impl", + }, } for _, tC := range testCases { t.Run(tC.desc, func(t *testing.T) { @@ -1288,7 +1292,7 @@ func testClientTimeout_Headers(t *testing.T, h2 bool) { donec := make(chan bool, 1) cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) { <-donec - })) + }), optQuietLog) defer cst.close() // Note that we use a channel send here and not a close. // The race detector doesn't know that we're waiting for a timeout |