projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
abfb38b
)
Skip cookie extraction if necessary
author
Ian Cordasco
<graffatcolmingov@gmail.com>
Sat, 17 Aug 2013 02:38:20 +0000
(21:38 -0500)
committer
Ian Cordasco
<graffatcolmingov@gmail.com>
Sat, 17 Aug 2013 02:38:20 +0000
(21:38 -0500)
If _original_response is never set/is None, then don't try to extract cookies
from the response.
requests/cookies.py
patch
|
blob
|
history
diff --git
a/requests/cookies.py
b/requests/cookies.py
index 3bfedcc49f432159375c74c67bab5a5a9e7f4243..f3ac64f0a3aabe3bf778dbc64d23868f8bf416e9 100644
(file)
--- a/
requests/cookies.py
+++ b/
requests/cookies.py
@@
-107,6
+107,9
@@
def extract_cookies_to_jar(jar, request, response):
:param request: our own requests.Request object
:param response: urllib3.HTTPResponse object
"""
+ if not (hasattr(response, '_original_response') and
+ response._original_response):
+ return
# the _original_response field is the wrapped httplib.HTTPResponse object,
req = MockRequest(request)
# pull out the HTTPMessage with the headers and put it in the mock: