Only process html responses

It tried to modify all responses, which added junk to the end of
non-html pages, and would cause errors trying to decode images as utf8.
This commit is contained in:
Matt Good
2011-12-19 15:55:44 -08:00
parent 0f64fdc715
commit 528a7dfc83

View File

@@ -116,7 +116,8 @@ class DebugToolbarExtension(object):
# If the http response code is 200 then we process to add the
# toolbar to the returned html response.
if response.status_code == 200:
if (response.status_code == 200
and response.headers['content-type'].startswith('text/html')):
for panel in self.debug_toolbars[real_request].panels:
panel.process_response(real_request, response)