[ZPT] CVS: Zope/lib/python/Products/PageTemplates - PageTemplateFile.py:1.20

Florent Guillaume fg@nuxeo.com
Thu, 5 Sep 2002 13:55:42 -0400


Update of /cvs-repository/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv15778

Modified Files:
	PageTemplateFile.py 
Log Message:
Only set the 'content-type' header if one doesn't already exist in the
response.
(Same change as ChrisM's in ZopePageTemplate.py)


=== Zope/lib/python/Products/PageTemplates/PageTemplateFile.py 1.19 => 1.20 ===
--- Zope/lib/python/Products/PageTemplates/PageTemplateFile.py:1.19	Wed Aug 14 18:17:24 2002
+++ Zope/lib/python/Products/PageTemplates/PageTemplateFile.py	Thu Sep  5 13:55:41 2002
@@ -82,8 +82,9 @@
         bound_names['options'] = kw
 
         try:
-            self.REQUEST.RESPONSE.setHeader('content-type',
-                                            self.content_type)
+            response = self.REQUEST.RESPONSE
+            if not response.headers.has_key('content-type'):
+                response.setHeader('content-type', self.content_type)
         except AttributeError: pass
 
         # Execute the template in a new security context.