You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DefaultBackoff in function has a logical flaw when handling the Retry-After header. If the server provides an unreasonably high value in the Retry-After header, the function respects it without enforcing the RetryWaitMax limit set for the httpClient. This can lead to indefinite wait times or blocking behaviour.
Steps to Reproduce
Simulate a server response with an HTTP 429 Too Many Requests status.
Set a high value in the Retry-After header (e.g., Retry-After: 3600 for 1 hour).
Observe that the backoff duration exceeds the configured RetryWaitMax limit.
Expected Behaviour
I believe the backoff duration should always be bounded by the configured RetryWaitMax value, regardless of the Retry-After header value.
Suggested Fix
Honour "Retry-After" header value only if its less than or equal to RetryWaitMax in default retry strategy
ifsleep<=max {
returnmax// Enforce max backoff limit
}
The text was updated successfully, but these errors were encountered:
go-retryablehttp/client.go
Lines 551 to 566 in 9dfd949
The DefaultBackoff in function has a logical flaw when handling the
Retry-After
header. If the server provides an unreasonably high value in the Retry-After header, the function respects it without enforcing theRetryWaitMax
limit set for the httpClient. This can lead to indefinite wait times or blocking behaviour.Steps to Reproduce
429 Too Many Requests
status.Retry-After
header (e.g.,Retry-After: 3600
for 1 hour).RetryWaitMax
limit.Expected Behaviour
I believe the backoff duration should always be bounded by the configured
RetryWaitMax
value, regardless of theRetry-After
header value.Suggested Fix
Honour "Retry-After" header value only if its less than or equal to RetryWaitMax in default retry strategy
The text was updated successfully, but these errors were encountered: