Accept unusual keys in cookies.

The Oreos module throws CookieErrors when it catches keys that have
characters that shouldn't be in them, like colons and braces. Other
services are happy to send out such keys, however. This commit makes
requests non-standards compliant, just like everyone else is.
This commit is contained in:
Cory Benfield
2012-02-14 00:03:03 +00:00
parent b7842ab34b
commit f72c13ffda
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -80,3 +80,4 @@ Patches and Suggestions
- David Kemp
- Brendon Crawford
- Denis (Telofy)
- Cory Benfield (Lukasa)
+2 -1
View File
@@ -252,7 +252,8 @@ class CookieError(Exception):
# _LegalChars is the list of chars which don't require "'s
# _Translator hash-table for fast quoting
#
_LegalChars = string.ascii_letters + string.digits + "!#$%&'*+-.^_`|~[]_"
_LegalChars = ( string.ascii_letters + string.digits +
"!#$%&'*+-.^_`|~[]_:{}" )
_Translator = {
'\000' : '\\000', '\001' : '\\001', '\002' : '\\002',
'\003' : '\\003', '\004' : '\\004', '\005' : '\\005',