Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

fix connection leak #162

Merged
merged 3 commits into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ func (c *Client) request(method, requestPath string, query url.Values, body []by
continue
}

defer resp.Body.Close()

// read the body (even on non-successful HTTP status codes), as that's what the unit tests expect
bodyContents, err = ioutil.ReadAll(resp.Body)
resp.Body.Close() //nolint:errcheck

// if there was an error reading the body, try again
if err != nil {
Expand Down