From: Cory Benfield Date: Tue, 14 Feb 2012 00:03:03 +0000 (+0000) Subject: Accept unusual keys in cookies. X-Git-Tag: v0.10.2~22^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f72c13ffdad47ff684d102b6d9fb6122db899891;p=services%2Fpython-requests.git 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. --- diff --git a/AUTHORS.rst b/AUTHORS.rst index 3e72f34..8cf76e9 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -80,3 +80,4 @@ Patches and Suggestions - David Kemp - Brendon Crawford - Denis (Telofy) +- Cory Benfield (Lukasa) diff --git a/requests/packages/oreos/monkeys.py b/requests/packages/oreos/monkeys.py index 2269e30..54975c8 100644 --- a/requests/packages/oreos/monkeys.py +++ b/requests/packages/oreos/monkeys.py @@ -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',