@playlive/tiltify-core
    Preparing search index...

    Function parseRetryAfter

    • 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").

      Parameters

      • headerValue: string | null

        Raw Retry-After header value (or null if absent).

      • nowMs: number

        Current epoch milliseconds. Injectable for tests.

      Returns number | null