Commit bf4da7a4 authored by Aymeric Augustin's avatar Aymeric Augustin
Browse files

[py3] Made a small fix in django.http.

This is necessary for the 'utils' tests to pass.
parent 9e0a10ba
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -549,7 +549,12 @@ class HttpResponse(object):
        for value in values:
            if isinstance(value, six.text_type):
                try:
                    if not six.PY3:
                        value = value.encode('us-ascii')
                    else:
                        # In Python 3, use a string in headers,
                        # but ensure in only contains ASCII characters.
                        value.encode('us-ascii')
                except UnicodeError as e:
                    e.reason += ', HTTP response headers must be in US-ASCII format'
                    raise