[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/ZReST/ZReST.py checking for 'REQUEST' in index_html()

Andreas Jung andreas at andreas-jung.com
Sat Nov 20 11:04:07 EST 2004


Log message for revision 28481:
  checking for 'REQUEST' in index_html()
  

Changed:
  U   Zope/trunk/lib/python/Products/ZReST/ZReST.py

-=-
Modified: Zope/trunk/lib/python/Products/ZReST/ZReST.py
===================================================================
--- Zope/trunk/lib/python/Products/ZReST/ZReST.py	2004-11-19 23:28:19 UTC (rev 28480)
+++ Zope/trunk/lib/python/Products/ZReST/ZReST.py	2004-11-20 16:04:07 UTC (rev 28481)
@@ -87,7 +87,8 @@
     def index_html(self, REQUEST=None):
         ''' Getting the formatted text
         '''
-        REQUEST.RESPONSE.setHeader('content-type', 'text/html; charset=%s' % self.output_encoding)
+        if REQUEST:
+            REQUEST.RESPONSE.setHeader('content-type', 'text/html; charset=%s' % self.output_encoding)
         return self.formatted
 
     security.declareProtected('View', 'source_txt')



More information about the Zope-Checkins mailing list