mirror of
https://github.com/golang/net.git
synced 2026-03-31 10:27:08 +09:00
webdav: fix recently-broken tests
The net/http package is now better at HTTP redirects, but that broke these tests which were trying to test the WebDAV server handler's behavior for a single roundtrip but were accidentally using the HTTP client (which does redirects) instead. Use the http.Transport which only does a single HTTP roundtrip. Change-Id: I8a0cfe2f841effc2f50c26f90c140e94e256a0ac Reviewed-on: https://go-review.googlesource.com/32413 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dominik Honnef <dominik@honnef.co> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
@@ -48,7 +48,7 @@ func TestPrefix(t *testing.T) {
|
||||
req.Header.Add(headers[0], headers[1])
|
||||
headers = headers[2:]
|
||||
}
|
||||
res, err := http.DefaultClient.Do(req)
|
||||
res, err := http.DefaultTransport.RoundTrip(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user