Kaydet (Commit) c05abb3b authored tarafından Andrew M. Kuchling's avatar Andrew M. Kuchling

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 '='.
üst 85cd1d69
......@@ -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'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment