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:
Brad Fitzpatrick
2016-10-30 17:33:00 +00:00
parent 76c1a11e06
commit d6520b84c8

View File

@@ -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
}