[Repoze-checkins] r1217 - in repoze.debug/trunk: . repoze/debug

Chris McDonough chrism at agendaless.com
Thu Jul 3 10:57:10 EDT 2008


Author: Chris McDonough <chrism at agendaless.com>
Date: Thu Jul  3 10:57:10 2008
New Revision: 1217

Log:
  - Fix debug UI bug: show escaped body regardless of content-type.



Modified:
   repoze.debug/trunk/CHANGES.txt
   repoze.debug/trunk/repoze/debug/ui.py
   repoze.debug/trunk/setup.py

Modified: repoze.debug/trunk/CHANGES.txt
==============================================================================
--- repoze.debug/trunk/CHANGES.txt	(original)
+++ repoze.debug/trunk/CHANGES.txt	Thu Jul  3 10:57:10 2008
@@ -1,3 +1,7 @@
+0.6.1 (2008/07/03)
+
+  - Fix debug UI bug: show escaped body regardless of content-type.
+
 0.6 (2008/07/02)
 
   - Fix logging bug.  Symptom: AttributeError: 'NoneType' object has

Modified: repoze.debug/trunk/repoze/debug/ui.py
==============================================================================
--- repoze.debug/trunk/repoze/debug/ui.py	(original)
+++ repoze.debug/trunk/repoze/debug/ui.py	Thu Jul  3 10:57:10 2008
@@ -109,26 +109,13 @@
                     s = header_fmt % (k, newv)
                     headers = headers + s
 
-                # If the response is text/xml, then include. If 
-                # text/html, cgi.escape and include. Otherwise, skip.
-                rh = dict(response['headers'])
-                ct = rh.get('Content-Type')
-                if ct is None:
-                    # 40x errors don't generate a content type
-                    body = ''
-                elif ct.startswith("text/xml"):
-                    body = response['body']
-                elif ct.startswith("text/html"):
-                    body = cgi.escape(response['body'])
-                else:
-                    body = ''
                 rzresponse = rzresponse_fmt % {
                     'begin': response['begin'],
                     'end': response['end'],
                     'content-length': response['content-length'],
                     'headers': headers,
                     'status': response['status'],
-                    'body': body,
+                    'body': cgi.escape(response['body']),
                     }
             else:
                 rzresponse = ''

Modified: repoze.debug/trunk/setup.py
==============================================================================
--- repoze.debug/trunk/setup.py	(original)
+++ repoze.debug/trunk/setup.py	Thu Jul  3 10:57:10 2008
@@ -12,7 +12,7 @@
 #
 ##############################################################################
 
-__version__ = '0.6'
+__version__ = '0.6.1'
 
 import os
 


More information about the Repoze-checkins mailing list