From: Kenneth Reitz Date: Sat, 19 Nov 2011 20:15:51 +0000 (-0500) Subject: cookies are oreos X-Git-Tag: v0.8.2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5309ad005f27b5ef4023c464d9f49614b1ee4c19;p=services%2Fpython-requests.git cookies are oreos --- diff --git a/requests/models.py b/requests/models.py index 098098e..808d336 100644 --- a/requests/models.py +++ b/requests/models.py @@ -18,6 +18,7 @@ from .auth import dispatch as auth_dispatch from .hooks import dispatch_hook from .structures import CaseInsensitiveDict from .status_codes import codes +from .packages import oreos from .packages.urllib3.exceptions import MaxRetryError from .packages.urllib3.exceptions import SSLError as _SSLError from .packages.urllib3.exceptions import HTTPError as _HTTPError @@ -143,7 +144,6 @@ class Request(object): from given response. """ - def build(resp): response = Response() @@ -165,12 +165,7 @@ class Request(object): # Add new cookies from the server. if 'set-cookie' in response.headers: cookie_header = response.headers['set-cookie'] - - c = SimpleCookie() - c.load(cookie_header) - - for k,v in c.items(): - cookies.update({k: v.value}) + cookies = oreos.dict_from_string(cookie_header) # Save cookies in Response. response.cookies = cookies @@ -185,7 +180,6 @@ class Request(object): return response - history = [] r = build(resp)