From 98b8316c0c1343f94749c3dde785ffaf7e70a04b Mon Sep 17 00:00:00 2001 From: ig0774 Date: Fri, 8 Jun 2012 09:35:54 -0300 Subject: [PATCH] Send the original response url to `urlparse` rather than the `Response` object. `urlparse` cannot handle `Response` objects. --- requests/cookies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests/cookies.py b/requests/cookies.py index 85726b0..0415856 100644 --- a/requests/cookies.py +++ b/requests/cookies.py @@ -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() -- 2.7.4