Skip to content

Parse Retry-After header with fractional seconds in RateLimitParser #746

Description

@Kingsman-99

Description

RateLimitParser parses the Retry-After header as an integer number of seconds using parseInt, which silently truncates fractional values (e.g., "1.5" becomes 1 s). Some Horizon nodes return sub-second retry hints.

Acceptance Criteria

  • parseRetryAfter(value: string): number uses parseFloat and returns milliseconds
  • HTTP-date format values are also handled and converted to a millisecond delay from now
  • Values that cannot be parsed return null rather than NaN
  • Unit tests pass

Context

  • Target file: src/throttle/RateLimitParser.ts
  • Return value unit is milliseconds throughout to match the rest of the throttle module

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions