web/request.py
changeset 10090 0aebb1c0f849
parent 10080 bc7c3b0f439b
child 10094 954765f57fb6
--- a/web/request.py	Wed Nov 19 11:57:55 2014 +0100
+++ b/web/request.py	Wed Nov 19 12:13:32 2014 +0100
@@ -128,8 +128,12 @@
             self.datadir_url = vreg.config.https_datadir_url
         else:
             self.datadir_url = vreg.config.datadir_url
+        #: enable UStringIO's write tracing
+        self.tracehtml = False
+        if vreg.config.debugmode:
+            self.tracehtml = bool(form.pop('_cwtracehtml', False))
         #: raw html headers that can be added from any view
-        self.html_headers = HTMLHead(self)
+        self.html_headers = HTMLHead(self, tracewrites=self.tracehtml)
         #: received headers
         self._headers_in = Headers()
         if headers is not None: