Parse a Retry-After header into a delay in milliseconds, supporting both
the delta-seconds form (Retry-After: 120) and the HTTP-date form as an
IMF-fixdate (Retry-After: Wed, 21 Oct 2026 07:28:00 GMT). Returns undefined
when the header is absent or anything else (-5, 1.5, 1e3, other date
formats), so the caller falls back to its own linear backoff. Bare Date.parse
is not used: it reads "-5" or "1.5" as a date in the past, i.e. a zero delay and
an instant retry burst.
Parse a
Retry-Afterheader into a delay in milliseconds, supporting both the delta-seconds form (Retry-After: 120) and the HTTP-date form as an IMF-fixdate (Retry-After: Wed, 21 Oct 2026 07:28:00 GMT). Returnsundefinedwhen the header is absent or anything else (-5,1.5,1e3, other date formats), so the caller falls back to its own linear backoff. BareDate.parseis not used: it reads "-5" or "1.5" as a date in the past, i.e. a zero delay and an instant retry burst.