Remove usage of http.DefaultClient
This commit is contained in:
parent
3fa57e61ba
commit
3c0ed11922
|
@ -83,7 +83,8 @@ func (c *AtlasClient) Get() (*Payload, error) {
|
|||
}
|
||||
|
||||
// Request the url
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -161,7 +162,8 @@ func (c *AtlasClient) Put(state []byte) error {
|
|||
req.ContentLength = int64(len(state))
|
||||
|
||||
// Make the request
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to upload state: %v", err)
|
||||
}
|
||||
|
@ -186,7 +188,8 @@ func (c *AtlasClient) Delete() error {
|
|||
}
|
||||
|
||||
// Make the request
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Failed to delete state: %v", err)
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ func TestHTTPClient(t *testing.T) {
|
|||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
client := &HTTPClient{URL: url, Client: http.DefaultClient}
|
||||
client := &HTTPClient{URL: url, Client: &http.Client{}}
|
||||
testClient(t, client)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue