Commit 27861bb7 authored by Florent Guillaume's avatar Florent Guillaume

Only set the 'content-type' header if one doesn't already exist in the

response.
(Same change as ChrisM's in ZopePageTemplate.py)
parent f85c290f
......@@ -15,7 +15,7 @@
Zope object encapsulating a Page Template from the filesystem.
"""
__version__='$Revision: 1.19 $'[11:-2]
__version__='$Revision: 1.20 $'[11:-2]
import os, AccessControl, Acquisition, sys
from Globals import package_home, DevelopmentMode
......@@ -82,8 +82,9 @@ class PageTemplateFile(Script, PageTemplate, Traversable):
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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment