feat(github): support HTTP-date format in Retry-After header #94
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The current Retry-After parsing in
github/client.goonly 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