mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
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>
This commit is contained in:
parent
b2ad7e0a2c
commit
359389ed51
3 changed files with 53 additions and 2 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue