diff options
| author | Claude Paroz <claude@2xlibre.net> | 2015-03-13 23:40:14 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2015-03-18 18:22:50 +0100 |
| commit | a0c2eb46dd5a782c11c44f13c8efad2778be1641 (patch) | |
| tree | 699c83457e903200607ae550abaacbd74d33941f /django/http | |
| parent | 0339844b70895d6162b4595ae615e6edf843c6cd (diff) | |
Fixed #23960 -- Removed http.fix_location_header
Thanks Carl Meyer for the report and Tim Graham for the review.
Diffstat (limited to 'django/http')
| -rw-r--r-- | django/http/__init__.py | 6 | ||||
| -rw-r--r-- | django/http/utils.py | 13 |
2 files changed, 3 insertions, 16 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py index cf1e5d3950..6f433b39b8 100644 --- a/django/http/__init__.py +++ b/django/http/__init__.py @@ -8,7 +8,7 @@ from django.http.response import ( HttpResponseNotFound, HttpResponseNotAllowed, HttpResponseGone, HttpResponseServerError, Http404, BadHeaderError, JsonResponse, ) -from django.http.utils import fix_location_header, conditional_content_removal +from django.http.utils import conditional_content_removal __all__ = [ 'SimpleCookie', 'parse_cookie', 'HttpRequest', 'QueryDict', @@ -17,6 +17,6 @@ __all__ = [ 'HttpResponsePermanentRedirect', 'HttpResponseNotModified', 'HttpResponseBadRequest', 'HttpResponseForbidden', 'HttpResponseNotFound', 'HttpResponseNotAllowed', 'HttpResponseGone', 'HttpResponseServerError', - 'Http404', 'BadHeaderError', 'fix_location_header', 'JsonResponse', - 'FileResponse', 'conditional_content_removal', + 'Http404', 'BadHeaderError', 'JsonResponse', 'FileResponse', + 'conditional_content_removal', ] diff --git a/django/http/utils.py b/django/http/utils.py index 5dcac06dcf..3ea71cb892 100644 --- a/django/http/utils.py +++ b/django/http/utils.py @@ -9,19 +9,6 @@ Functions that modify an HTTP request or response in some way. # universally applicable. -def fix_location_header(request, response): - """ - Ensures that we always use an absolute URI in any location header in the - response. This is required by RFC 2616, section 14.30. - - Code constructing response objects is free to insert relative paths, as - this function converts them to absolute paths. - """ - if 'Location' in response: - response['Location'] = request.build_absolute_uri(response['Location']) - return response - - def conditional_content_removal(request, response): """ Removes the content of responses for HEAD requests, 1xx, 204 and 304 |
