fix: retry immediately on non-positive numeric Retry-After header
The numeric Retry-After branch multiplied the header value by 1000 without guarding non-positive results, so `Retry-After: 0` produced a falsy delay that fell through to exponential backoff instead of retrying immediately. The RFC-1123 date branch already clamps non-positive values to 1ms; mirror that guard in the numeric branch so a non-positive Retry-After retries at once.
This commit is contained in:
1 parent
7eb9032cf2
commit
3ce94ca09d
2 files changed
+25
No files matched your search
@@ -532,6 +532,10 @@ export default class Request extends Duplex implements RequestEvents<Request> {
|
||||
}
|
||||
} else {
|
||||
retryAfter *= 1000;
|
||||
|
||||
if (retryAfter <= 0) {
|
||||
retryAfter = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user