1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Added a get_host() method to HttpRequest. There is still an http.get_host() version in place, so this is fully backwards compatible.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2007-09-15 17:46:03 +00:00
parent 061ed82b22
commit 4b610f42d3
5 changed files with 23 additions and 20 deletions

View File

@@ -142,7 +142,7 @@ def fix_location_header(request, response):
Code constructing response objects is free to insert relative paths and
this function converts them to absolute paths.
"""
if 'Location' in response and http.get_host(request):
if 'Location' in response and request.get_host():
response['Location'] = request.build_absolute_uri(response['Location'])
return response