From df7aece2c8aef689a4b1f71126b93a5f09a3d168 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Thu, 10 Oct 2013 20:43:18 -0500 Subject: [PATCH] Comment our reasonsing for the special cases --- requests/cookies.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/requests/cookies.py b/requests/cookies.py index 4d1708d..a53f210 100644 --- 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 -- 2.34.1