Kaydet (Commit) c35501a1 authored tarafından Claude Paroz's avatar Claude Paroz

[py3] Fixed HttpResponse when initialized with bytes

üst a351e383
......@@ -676,7 +676,7 @@ class HttpResponse(object):
return b''.join([smart_bytes(e, self._charset) for e in self._container])
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._base_content_is_iter = True
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment