Skip to content

Parse standard cookie Expires dates from Morsel#7541

Closed
lin-hongkuan wants to merge 1 commit into
psf:mainfrom
lin-hongkuan:codex/morsel-expires-http-date
Closed

Parse standard cookie Expires dates from Morsel#7541
lin-hongkuan wants to merge 1 commit into
psf:mainfrom
lin-hongkuan:codex/morsel-expires-http-date

Conversation

@lin-hongkuan

Copy link
Copy Markdown

Summary

  • parse Morsel expires values with http.cookiejar.http2time instead of a single fixed strptime template
  • keep invalid expires values rejected when the stdlib parser cannot parse them
  • add regression coverage for RequestsCookieJar.update(SimpleCookie(...)) with a standard HTTP-date Expires value

Fixes #6004

Testing

  • python -c "import sys, pytest; sys.path.insert(0, 'src'); raise SystemExit(pytest.main(['tests/test_requests.py::TestMorselToCookieExpires', '-q']))"
  • python -m ruff check src/requests/cookies.py tests/test_requests.py
  • git diff --check

@DTiming24

This comment was marked as spam.

@nateprewitt nateprewitt added spam mass-automation-pr This PR was created from an account spamming large projects with "fixes". labels Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mass-automation-pr This PR was created from an account spamming large projects with "fixes". spam

Projects

None yet

Development

Successfully merging this pull request may close these issues.

For Morsel cookies requests expects wrong Expires time format

3 participants