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:
7ba5a53
)
Better layout for checking.
author
Cory Benfield
<lukasaoz@gmail.com>
Thu, 30 Jan 2014 15:11:24 +0000
(15:11 +0000)
committer
Cory Benfield
<lukasaoz@gmail.com>
Thu, 30 Jan 2014 15:11:24 +0000
(15:11 +0000)
requests/sessions.py
patch
|
blob
|
history
diff --git
a/requests/sessions.py
b/requests/sessions.py
index 22fe22f87681deb62f73cba13accbf72e05b72d9..531fd667de1a885e127489c384e08b6c9f30bfe6 100644
(file)
--- a/
requests/sessions.py
+++ b/
requests/sessions.py
@@
-163,11
+163,9
@@
class SessionRedirectMixin(object):
original_parsed = urlparse(resp.request.url)
redirect_parsed = urlparse(url)
- if original_parsed.hostname != redirect_parsed.hostname:
- try:
- del headers['Authorization']
- except KeyError:
- pass
+ if (original_parsed.hostname != redirect_parsed.hostname and
+ 'Authorization' in headers):
+ del headers['Authorization']
# However, .netrc might have more auth for us. Let's get it if it
# does.