Parses a Retry-After
header value into a millisecond delay.
Accepts both formats the RFC allows:
delta-seconds — a non-negative decimal ("3", "0.5"). The seconds
form is what Cloudflare / Tiltify's CDN actually emits in practice, but
we handle the date form too for completeness.
HTTP-date — an RFC 1123 / RFC 7231 date string ("Wed, 21 Oct 2026 07:28:00 GMT"). Converted to a delta against nowMs.
Returns null for missing, malformed, or negative values so the caller
can fall back to exponential backoff without a second null-check dance.
Zero is valid and returned as 0 (server says "retry immediately").
Parses a
Retry-Afterheader value into a millisecond delay.Accepts both formats the RFC allows:
"3","0.5"). The seconds form is what Cloudflare / Tiltify's CDN actually emits in practice, but we handle the date form too for completeness."Wed, 21 Oct 2026 07:28:00 GMT"). Converted to a delta againstnowMs.Returns
nullfor missing, malformed, or negative values so the caller can fall back to exponential backoff without a second null-check dance. Zero is valid and returned as0(server says "retry immediately").