Skip to content

Commit 66adbea

Browse files
fix: close body before retrying
1 parent 9de5708 commit 66adbea

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
@@ -461,6 +461,11 @@ func (cfg *RequestConfig) Execute() (err error) {
461461
break
462462
}
463463

464+
// Close the response body before retrying to prevent connection leaks
465+
if res != nil && res.Body != nil {
466+
res.Body.Close()
467+
}
468+
464469
time.Sleep(retryDelay(res, retryCount))
465470
}
466471

0 commit comments

Comments
 (0)