mirror of
https://github.com/pallets-eco/flask-debugtoolbar.git
synced 2025-12-30 18:19:31 -06:00
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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user