[ZPT] CVS: Zope27/lib/python/Products/PageTemplates - PageTemplateFile.py:1.14.18.2 ZopePageTemplate.py:1.41.6.1

Florent Guillaume fg@nuxeo.com
Sun, 8 Sep 2002 14:47:50 -0400


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

Modified Files:
      Tag: Zope-2_7-development-branch
	PageTemplateFile.py ZopePageTemplate.py 
Log Message:
Port Content-Type fixes from HEAD:
Only set the 'content-type' header if one doesn't already exist in the
response.


=== Zope27/lib/python/Products/PageTemplates/PageTemplateFile.py 1.14.18.1 => 1.14.18.2 ===
--- Zope27/lib/python/Products/PageTemplates/PageTemplateFile.py:1.14.18.1	Thu Jul 18 12:18:59 2002
+++ Zope27/lib/python/Products/PageTemplates/PageTemplateFile.py	Sun Sep  8 14:47:50 2002
@@ -82,9 +82,11 @@
         bound_names['options'] = kw
 
         try:
-            self.REQUEST.RESPONSE.setHeader('content-type',
-                                            self.content_type)
-        except AttributeError: pass
+            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.
         security=getSecurityManager()


=== Zope27/lib/python/Products/PageTemplates/ZopePageTemplate.py 1.41 => 1.41.6.1 ===
--- Zope27/lib/python/Products/PageTemplates/ZopePageTemplate.py:1.41	Fri Jun  7 16:27:58 2002
+++ Zope27/lib/python/Products/PageTemplates/ZopePageTemplate.py	Sun Sep  8 14:47:50 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