Browse Source

flask view function may return bytes/str/unicode

pull/751/head
Thomas Waldmann 12 years ago
parent
commit
bbfef4c406
  1. 2
      flask/app.py

2
flask/app.py

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

Loading…
Cancel
Save