summaryrefslogtreecommitdiff
path: root/django/http
diff options
context:
space:
mode:
authorJerome Leclanche <jerome@leclan.ch>2016-12-17 17:34:32 +0200
committerTim Graham <timograham@gmail.com>2016-12-19 10:01:03 -0500
commita849ec1880e6e9926bd04e298c0ded2611cfb4b3 (patch)
tree941f038a22c28d0975fe2bf312266faef7fbc0c3 /django/http
parent6af23a4521fcf80aec7c5ee3988914423c7dfccd (diff)
Fixed #27606 -- Fixed HttpResponseRedirect.__repr__() crash when DisallowedRedirect is raised.
Diffstat (limited to 'django/http')
-rw-r--r--django/http/response.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/http/response.py b/django/http/response.py
index 89c1c0a5fd..48b4b525b9 100644
--- a/django/http/response.py
+++ b/django/http/response.py
@@ -420,11 +420,11 @@ class HttpResponseRedirectBase(HttpResponse):
allowed_schemes = ['http', 'https', 'ftp']
def __init__(self, redirect_to, *args, **kwargs):
+ super(HttpResponseRedirectBase, self).__init__(*args, **kwargs)
+ self['Location'] = iri_to_uri(redirect_to)
parsed = urlparse(force_text(redirect_to))
if parsed.scheme and parsed.scheme not in self.allowed_schemes:
raise DisallowedRedirect("Unsafe redirect to URL with protocol '%s'" % parsed.scheme)
- super(HttpResponseRedirectBase, self).__init__(*args, **kwargs)
- self['Location'] = iri_to_uri(redirect_to)
url = property(lambda self: self['Location'])