From bbfef4c406506d89c662038c11c6c67bc97b67e3 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Thu, 30 May 2013 16:02:28 +0200 Subject: [PATCH] flask view function may return bytes/str/unicode --- flask/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask/app.py b/flask/app.py index c3bbc907..bfd615b7 100644 --- a/flask/app.py +++ b/flask/app.py @@ -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: