Skip to content

Commit 670a374

Browse files
committed
Fix: Socket leaks if server returns RateLimitExceededStatus status.
1 parent 831b724 commit 670a374

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

exporter/http.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ func getHTTPResponse(url string, token string) (*http.Response, error) {
146146

147147
// check rate limit exceeded.
148148
if resp.Status == RateLimitExceededStatus {
149+
resp.Body.Close()
149150
return nil, fmt.Errorf("%s", resp.Status)
150151
}
151152

0 commit comments

Comments
 (0)