From 71bd15a4d6fbe78adb3aeefa95081ec6fed05aa2 Mon Sep 17 00:00:00 2001 From: Rune Halvorsen Date: Wed, 29 Feb 2012 01:44:17 +0100 Subject: [PATCH] Added an exception when debug toolbar can't be inserted due to missing markup --- flask_debugtoolbar/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/flask_debugtoolbar/__init__.py b/flask_debugtoolbar/__init__.py index e984938..0852d47 100644 --- a/flask_debugtoolbar/__init__.py +++ b/flask_debugtoolbar/__init__.py @@ -168,6 +168,12 @@ class DebugToolbarExtension(object): if response.is_sequence: response_html = response.data.decode(response.charset) + + if not "" in response_html: + raise RuntimeError( + "The Flask-DebugToolbar requires there to be a " + "closing body tag in the html.") + toolbar_html = self.debug_toolbars[real_request].render_toolbar() content = replace_insensitive(