Skip to content

Commit ce52163

Browse files
fix: close body before retrying
1 parent 3c81b19 commit ce52163

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/requestconfig/requestconfig.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,11 @@ func (cfg *RequestConfig) Execute() (err error) {
465465
break
466466
}
467467

468+
// Close the response body before retrying to prevent connection leaks
469+
if res != nil && res.Body != nil {
470+
res.Body.Close()
471+
}
472+
468473
time.Sleep(retryDelay(res, retryCount))
469474
}
470475

0 commit comments

Comments
 (0)