Skip to content

Commit 45e2cd0

Browse files
Properly close response body
This was the connection can properly be reused or closed without it hanging.
1 parent cfa8668 commit 45e2cd0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

internal/cloudflare/credentials.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func (c *CredentialsClient) fetchCredentials(ctx context.Context) (*Credentials,
9797
if err != nil {
9898
return nil, err
9999
}
100+
defer resp.Body.Close() //nolint:errcheck
100101

101102
if resp.StatusCode/100 != 2 {
102103
return nil, fmt.Errorf("unexpected error from Cloudflare: %s", resp.Status)

0 commit comments

Comments
 (0)