Commit 2e8aa62f authored by Andreas Jung's avatar Andreas Jung

added workaround where guess_content_type() did not detect text/xml properly

(should be fixed in Zope 3)
parent 58887b30
...@@ -32,6 +32,13 @@ from zope.pagetemplate.pagetemplatefile import sniff_type ...@@ -32,6 +32,13 @@ from zope.pagetemplate.pagetemplatefile import sniff_type
LOG = getLogger('PageTemplateFile') LOG = getLogger('PageTemplateFile')
def guess_type(filename, text): def guess_type(filename, text):
# check for XML ourself since guess_content_type can't
# detect text/xml if 'filename' won't end with .xml
if text.startswith('<?xml'):
return 'text/xml'
content_type, dummy = guess_content_type(filename, text) content_type, dummy = guess_content_type(filename, text)
if content_type in ('text/html', 'text/xml'): if content_type in ('text/html', 'text/xml'):
return content_type return content_type
......
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