diff options
author | Nano <nanoapezlk@gmail.com> | 2024-12-11 13:28:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-11 13:28:19 (GMT) |
commit | 359389ed51aecc107681e600b71852c0a97304e1 (patch) | |
tree | 69602af88713c6ff71dd0d388cf727a58d9e839f /Lib/http | |
parent | b2ad7e0a2c1518539d9b0ef83c9f7a09d10fd303 (diff) | |
download | cpython-359389ed51aecc107681e600b71852c0a97304e1.zip cpython-359389ed51aecc107681e600b71852c0a97304e1.tar.gz cpython-359389ed51aecc107681e600b71852c0a97304e1.tar.bz2 |
gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (#123405)
Co-authored-by: Wulian <1055917385@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Lib/http')
-rw-r--r-- | Lib/http/cookies.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/http/cookies.py b/Lib/http/cookies.py index d7e8d08..23d5461 100644 --- a/Lib/http/cookies.py +++ b/Lib/http/cookies.py @@ -425,9 +425,11 @@ _CookiePattern = re.compile(r""" ( # Optional group: there may not be a value. \s*=\s* # Equal Sign (?P<val> # Start of group 'val' - "(?:[^\\"]|\\.)*" # Any doublequoted string + "(?:[^\\"]|\\.)*" # Any double-quoted string | # or - \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT # Special case for "expires" attr + # Special case for "expires" attr + (\w{3,6}day|\w{3}),\s # Day of the week or abbreviated day + [\w\d\s-]{9,11}\s[\d:]{8}\sGMT # Date and time in specific format | # or [""" + _LegalValueChars + r"""]* # Any word or empty string ) # End of group 'val' |