Skip to content

Read asctime Retry-After dates as UTC - #6

Merged
sinnercode228 merged 1 commit into
sinnercode228:mainfrom
snehaapratap:fix/4-asctime-retry-after
Nov 2, 2026
Merged

sinnercode228 merged 1 commit into
sinnercode228:mainfrom
snehaapratap:fix/4-asctime-retry-after

Conversation

@snehaapratap

Copy link
Copy Markdown
Contributor

Read an asctime Retry-After as UTC so a 429 waits the requested time instead of falling back to jitter. Recognize the exact asctime layout before adding the implicit zone; other zone-less dates, including -0000, remain ignored.

Fixes #4. This follows RFC 9110 §5.6.7. Both READMEs and the next-version Unreleased changelog are updated.

Validation: 365 tests pass; four added regression cases failed before the fix (three asctime date forms and a mocked client retry). Coverage includes past dates, RFC 850/IMF-fixdate parity, invalid dates and existing zone-less rejection. ruff check, ruff format --check, mypy --strict src, mypy, wheel/sdist build, twine check --strict and git diff --check pass on Python 3.12. No requests went to a live amoCRM account.

Implemented and reviewed with OpenAI Codex assistance.

@sinnercode228
sinnercode228 merged commit 5fc1bfc into sinnercode228:main Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read a Retry-After given in the asctime date format

2 participants