feat(github): support HTTP-date format in Retry-After header #94

Closed
opened 2026-05-12 23:38:53 +00:00 by rodin · 0 comments
Owner

Context

The current Retry-After parsing in github/client.go only supports integer seconds. Per RFC 7231, servers may also send an HTTP-date format (e.g. Retry-After: Thu, 01 Dec 2025 16:00:00 GMT).

Current Behavior

Only strconv.Atoi(ra) is tried. If the value is an HTTP-date, it's silently ignored and the default backoff is used.

Expected Behavior

Parse both integer seconds and HTTP-date formats. For HTTP-date, compute the delay as the difference between the parsed time and time.Now().

Notes

  • GitHub in practice only returns integer seconds, so this is a defense-in-depth/interoperability enhancement rather than a bug fix.
  • Identified during review of PR #93 (GPT review finding #1).
  • Low priority.
## Context The current Retry-After parsing in `github/client.go` only supports integer seconds. Per RFC 7231, servers may also send an HTTP-date format (e.g. `Retry-After: Thu, 01 Dec 2025 16:00:00 GMT`). ## Current Behavior Only `strconv.Atoi(ra)` is tried. If the value is an HTTP-date, it's silently ignored and the default backoff is used. ## Expected Behavior Parse both integer seconds and HTTP-date formats. For HTTP-date, compute the delay as the difference between the parsed time and `time.Now()`. ## Notes - GitHub in practice only returns integer seconds, so this is a defense-in-depth/interoperability enhancement rather than a bug fix. - Identified during review of PR #93 (GPT review finding #1). - Low priority.
rodin self-assigned this 2026-05-13 12:03:08 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rodin/review-bot#94