summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbottle.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bottle.py b/bottle.py
index f5ff19b..326c7df 100755
--- a/bottle.py
+++ b/bottle.py
@@ -452,6 +452,11 @@ class Bottle(object):
Support: False, str, unicode, dict, HTTPResponse, HTTPError, file-like,
iterable of strings and iterable of unicodes
"""
+ # Filtered types (recursive, because they may return anything)
+ for testtype, filterfunc in self.castfilter:
+ if isinstance(out, testtype):
+ return self._cast(filterfunc(out))
+
# Empty output is done here
if not out:
response.headers['Content-Length'] = 0
@@ -474,11 +479,6 @@ class Bottle(object):
out.apply(response)
return self._cast(out.output)
- # Filtered types (recursive, because they may return anything)
- for testtype, filterfunc in self.castfilter:
- if isinstance(out, testtype):
- return self._cast(filterfunc(out))
-
# Cast Files into iterables
if hasattr(out, 'read') and 'wsgi.file_wrapper' in request.environ:
out = request.environ.get('wsgi.file_wrapper',