Send the original response url to `urlparse` rather than the `Response` object. ...
authorig0774 <ig0774@yahoo.com>
Fri, 8 Jun 2012 12:35:54 +0000 (09:35 -0300)
committerig0774 <ig0774@yahoo.com>
Fri, 8 Jun 2012 12:35:54 +0000 (09:35 -0300)
requests/cookies.py

index 85726b0..0415856 100644 (file)
@@ -39,7 +39,7 @@ class MockRequest(object):
     def get_origin_req_host(self):
         if self._r.response.history:
             r = self._r.response.history[0]
-            return urlparse(r).netloc
+            return urlparse(r.url).netloc
         else:
             return self.get_host()