[ZPT] CVS: Zope/lib/python/Products/PageTemplates - ZopePageTemplate.py:1.43

Chris McDonough chrism@zope.com
Wed, 28 Aug 2002 18:18:14 -0400


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

Modified Files:
	ZopePageTemplate.py 
Log Message:
Only set the 'content-type' header if one doesn't already exist in the
response.


=== Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py 1.42 => 1.43 ===
--- Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py:1.42	Wed Aug 14 18:17:24 2002
+++ Zope/lib/python/Products/PageTemplates/ZopePageTemplate.py	Wed Aug 28 18:18:12 2002
@@ -202,8 +202,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