diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2018-03-12 18:01:27 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2018-03-12 18:04:23 +0300 |
commit | 0a18027e81ca05ed6392fe4669340de4ee18eec0 (patch) | |
tree | 6348f01126f7633c2cb19ea73b62f321e22c208d | |
parent | 575f1200cb93e7e8241ab0fbfe773b5f3c2d0b22 (diff) |
Fix response timeout swap in test
-rw-r--r-- | acceptance_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/acceptance_test.go b/acceptance_test.go index 9d4c3302..ff80a7a4 100644 --- a/acceptance_test.go +++ b/acceptance_test.go @@ -320,10 +320,11 @@ func TestObscureMIMEType(t *testing.T) { func TestArtifactProxyRequest(t *testing.T) { skipUnlessEnabled(t) - defer func(rt http.RoundTripper) { - InsecureHTTPSClient.Transport = rt - }(InsecureHTTPSClient.Transport) - (InsecureHTTPSClient.Transport).(*http.Transport).ResponseHeaderTimeout = 5 * time.Second + transport := (InsecureHTTPSClient.Transport).(*http.Transport) + defer func(t time.Duration) { + transport.ResponseHeaderTimeout = t + }(transport.ResponseHeaderTimeout) + transport.ResponseHeaderTimeout = 5 * time.Second content := "<!DOCTYPE html><html><head><title>Title of the document</title></head><body></body></html>" contentLength := int64(len(content)) |