Skip to content

Commit d6520b8

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dominik Honnef <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 76c1a11 commit d6520b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

webdav/webdav_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestPrefix(t *testing.T) {
4848
req.Header.Add(headers[0], headers[1])
4949
headers = headers[2:]
5050
}
51-
res, err := http.DefaultClient.Do(req)
51+
res, err := http.DefaultTransport.RoundTrip(req)
5252
if err != nil {
5353
return nil, err
5454
}

0 commit comments

Comments
 (0)