Comment our reasonsing for the special cases
authorIan Cordasco <graffatcolmingov@gmail.com>
Fri, 11 Oct 2013 01:43:18 +0000 (20:43 -0500)
committerIan Cordasco <graffatcolmingov@gmail.com>
Fri, 11 Oct 2013 01:43:18 +0000 (20:43 -0500)
requests/cookies.py

index 4d1708d4e10e26dfb55bc19d497967877e538cbf..a53f2104b7c3ad4c3d48e1c4fa37b37eb1598d41 100644 (file)
@@ -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