flask view function may return bytes/str/unicode

This commit is contained in:
Thomas Waldmann 2013-05-30 16:02:28 +02:00
parent 51042f4c9f
commit bbfef4c406

View file

@ -1551,7 +1551,7 @@ class Flask(_PackageBoundObject):
# set the headers and status. We do this because there can be
# some extra logic involved when creating these objects with
# specific values (like default content type selection).
if isinstance(rv, string_types):
if isinstance(rv, string_types + (bytes, )):
rv = self.response_class(rv, headers=headers, status=status)
headers = status = None
else: