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:
0bb8be0
)
Comment our reasonsing for the special cases
author
Ian Cordasco
<graffatcolmingov@gmail.com>
Fri, 11 Oct 2013 01:43:18 +0000
(20:43 -0500)
committer
Ian Cordasco
<graffatcolmingov@gmail.com>
Fri, 11 Oct 2013 01:43:18 +0000
(20:43 -0500)
requests/cookies.py
patch
|
blob
|
history
diff --git
a/requests/cookies.py
b/requests/cookies.py
index 4d1708d4e10e26dfb55bc19d497967877e538cbf..a53f2104b7c3ad4c3d48e1c4fa37b37eb1598d41 100644
(file)
--- a/
requests/cookies.py
+++ b/
requests/cookies.py
@@
-45,10
+45,14
@@
class MockRequest(object):
return self.get_host()
def get_full_url(self):
+ # Only return the response's URL if the user hadn't set the Host
+ # header
if not self._r.headers.get('Host'):
return self._r.url
+ # If they did set it, retrieve it and reconstruct the expected doain
host = self._r.headers['Host']
parsed = urlparse(self._r.url)
+ # Reconstruct the URL as we expect it
return urlunparse([
parsed.scheme, host, parsed.path, parsed.params, parsed.query,
parsed.fragment