소스 검색

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>
Brad Fitzpatrick 9 년 전
부모
커밋
d6520b84c8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      webdav/webdav_test.go

+ 1 - 1
webdav/webdav_test.go

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