cookies are oreos

This commit is contained in:
Kenneth Reitz
2011-11-19 15:15:51 -05:00
parent 43854067d4
commit 5309ad005f
+2 -8
View File
@@ -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)