[Zope-Checkins] CVS: Zope2 - content_types.py:1.13.16.1
andreas@serenade.digicool.com
andreas@serenade.digicool.com
Thu, 31 May 2001 08:53:56 -0400
Update of /cvs-repository/Zope2/lib/python/OFS
In directory serenade:/tmp/cvs-serv24575/OFS
Modified Files:
Tag: zope-2_3-branch
content_types.py
Log Message:
added support for detecting XML files and setting the content-type
to text/xml (Collector #2248)
--- Updated File content_types.py in package Zope2 --
--- content_types.py 2000/12/12 16:03:50 1.13
+++ content_types.py 2001/05/31 12:53:55 1.13.16.1
@@ -95,7 +95,10 @@
# Yuk. See if we can figure out the type by content.
if (lower(strip(s)[:6]) == '<html>' or find(s, '</') > 0):
return 'text/html'
- return 'text/plain'
+ elif strip(s)[:5]=='<?xml':
+ return 'text/xml'
+ else:
+ return 'text/plain'