Skip to content

Commit

Permalink
Remove usage of http.DefaultClient
Browse files Browse the repository at this point in the history
  • Loading branch information
jefferai committed Oct 19, 2015
1 parent 3fa57e6 commit 3c0ed11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions state/remote/atlas.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion state/remote/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 3c0ed11

Please sign in to comment.