Added an exception when debug toolbar can't be inserted due to missing markup

This commit is contained in:
Rune Halvorsen
2012-02-29 01:44:17 +01:00
parent 7e8a8e280e
commit 71bd15a4d6

View File

@@ -168,6 +168,12 @@ class DebugToolbarExtension(object):
if response.is_sequence:
response_html = response.data.decode(response.charset)
if not "</body>" 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(