[Zope3-checkins] CVS: Zope3/src/zope/app/dav - propfind.py:1.18

Fred L. Drake, Jr. fred at zope.com
Thu May 6 11:36:47 EDT 2004


Update of /cvs-repository/Zope3/src/zope/app/dav
In directory cvs.zope.org:/tmp/cvs-serv2271

Modified Files:
	propfind.py 
Log Message:
- parse the request Content-Type appropriately; parameters should not
  be used to determine the major/minor content type
- convert the major/minor to lower case before saving it, since it's
  always right to consider it without regard to case
(closes Zope3 collector bug #206)


=== Zope3/src/zope/app/dav/propfind.py 1.17 => 1.18 ===
--- Zope3/src/zope/app/dav/propfind.py:1.17	Sat Mar  6 12:48:48 2004
+++ Zope3/src/zope/app/dav/propfind.py	Thu May  6 11:36:45 2004
@@ -31,7 +31,14 @@
         self.context = context
         self.request = request
         self.setDepth(request.getHeader('depth', 'infinity'))
-        self.content_type = request.getHeader('content-type', 'text/xml')
+        ct = request.getHeader('content-type', 'text/xml')
+        if ';' in ct:
+            parts = ct.split(';', 1)
+            self.content_type = parts[0].strip().lower()
+            self.content_type_params = parts[1].strip()
+        else:
+            self.content_type = ct.lower()
+            self.content_type_params = None
         self.default_ns = 'DAV:'
 
     def getDepth(self):
@@ -50,7 +57,7 @@
         response = ''
         body = ''
 
-        if self.content_type.lower() not in ['text/xml', 'application/xml']:
+        if self.content_type not in ['text/xml', 'application/xml']:
             request.response.setStatus(400)
             return body
 




More information about the Zope3-Checkins mailing list