Skip to content

parseRetryAfter

parseRetryAfter(header): number | undefined

Defined in: packages/core/src/errors.ts:180

Parse a Retry-After header value (delta-seconds OR an HTTP-date) into milliseconds. Returns undefined when the header is absent, unparseable, or non-positive.

A non-positive value is treated as “no hint” rather than 0: a literal Retry-After: 0 must not collapse exponential backoff into a zero-delay retry storm against the very endpoint that is rate-limiting the client.

string | null

number | undefined

Unofficial. Lonca is an independent, community-maintained project — not affiliated with, endorsed by, or supported by Trendyol, Hepsiburada, or any other marketplace. All marketplace names and trademarks belong to their respective owners.