Comment our reasonsing for the special cases

This commit is contained in:
Ian Cordasco
2013-10-10 20:43:18 -05:00
parent 0bb8be0e5b
commit df7aece2c8
+4
View 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