Accept unusual keys in cookies.
authorCory Benfield <lukasaoz@gmail.com>
Tue, 14 Feb 2012 00:03:03 +0000 (00:03 +0000)
committerCory Benfield <lukasaoz@gmail.com>
Tue, 14 Feb 2012 00:10:26 +0000 (00:10 +0000)
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.

AUTHORS.rst
requests/packages/oreos/monkeys.py

index 3e72f34d66f9ccce4541874afd65cded30ae4bc8..8cf76e9d5e452fc603e12bc749b3a360147283d9 100644 (file)
@@ -80,3 +80,4 @@ Patches and Suggestions
 - David Kemp
 - Brendon Crawford
 - Denis (Telofy)
+- Cory Benfield (Lukasa)
index 2269e30b69700c2eb49aa2bf23c5ed23716529e4..54975c8fda1c2cf94dd7cf8ae3d23f152f8a3d8e 100644 (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',