feat: switch to proxy when need be

This commit is contained in:
James Houlahan
2020-04-01 17:20:03 +02:00
parent f239e8f3bf
commit ce29d4d74e
36 changed files with 311 additions and 320 deletions

View File

@ -51,7 +51,7 @@ func TestClient_Do(t *testing.T) {
}))
defer s.Close()
req, err := NewRequest("GET", "/", nil)
req, err := c.NewRequest("GET", "/", nil)
if err != nil {
t.Fatal("Expected no error while creating request, got:", err)
}
@ -163,8 +163,8 @@ func TestClient_FirstReadTimeout(t *testing.T) {
)
defer finish()
c.client.Transport = &slowTransport{
transport: c.client.Transport,
c.hc.Transport = &slowTransport{
transport: c.hc.Transport,
firstBodySleep: requestTimeout,
}