summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2001-02-20 22:11:24 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2001-02-20 22:11:24 (GMT)
commitc05abb3bdaa87b6e5ea2d6db1e5d6145ae2b0440 (patch)
tree027b9f30963f559938816ac9a8c467d46caf7422 /Lib
parent85cd1d690cfd0bad9b6ee98578fadf2a7d8988e9 (diff)
downloadcpython-c05abb3bdaa87b6e5ea2d6db1e5d6145ae2b0440.zip
cpython-c05abb3bdaa87b6e5ea2d6db1e5d6145ae2b0440.tar.gz
cpython-c05abb3bdaa87b6e5ea2d6db1e5d6145ae2b0440.tar.bz2
Patch #103473 from dougfort: Some sites (amazon.com for one) drop
cookies that contain '=' as part of the value. This patch modifies Cookie.py to allow '=' as a legal character, and to make the key search nongreedy so it stops at the first '='.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/Cookie.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/Cookie.py b/Lib/Cookie.py
index 565e6f3..f4d73e6 100644
--- a/Lib/Cookie.py
+++ b/Lib/Cookie.py
@@ -521,11 +521,11 @@ class Morsel(UserDict):
# result, the parsing rules here are less strict.
#
-_LegalCharsPatt = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{]"
+_LegalCharsPatt = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]"
_CookiePattern = re.compile(
r"(?x)" # This is a Verbose pattern
r"(?P<key>" # Start of group 'key'
- ""+ _LegalCharsPatt +"+" # Any word of at least one letter
+ ""+ _LegalCharsPatt +"+?" # Any word of at least one letter, nongreedy
r")" # End of group 'key'
r"\s*=\s*" # Equal Sign
r"(?P<val>" # Start of group 'val'