mirror of
https://github.com/django/django.git
synced 2025-01-13 11:57:01 +00:00
[py3] Fixed HttpResponse when initialized with bytes
This commit is contained in:
parent
a351e383b6
commit
c35501a128
@ -676,7 +676,7 @@ class HttpResponse(object):
|
|||||||
return b''.join([smart_bytes(e, self._charset) for e in self._container])
|
return b''.join([smart_bytes(e, self._charset) for e in self._container])
|
||||||
|
|
||||||
def _set_content(self, value):
|
def _set_content(self, value):
|
||||||
if hasattr(value, '__iter__') and not isinstance(value, six.string_types):
|
if hasattr(value, '__iter__') and not isinstance(value, (bytes, six.string_types)):
|
||||||
self._container = value
|
self._container = value
|
||||||
self._base_content_is_iter = True
|
self._base_content_is_iter = True
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user