Преглед на файлове

accepts PROPFIND whitout request body

Christoph Polcin преди 13 години
родител
ревизия
9972897d75
променени са 1 файла, в които са добавени 11 реда и са изтрити 3 реда
  1. 11 3
      radicale/xmlutils.py

+ 11 - 3
radicale/xmlutils.py

@@ -195,10 +195,18 @@ def propfind(path, xml_request, collections, user=None):
 
     """
     # Reading request
-    root = ET.fromstring(xml_request.encode("utf8"))
+    if xml_request:
+        root = ET.fromstring(xml_request.encode("utf8"))
 
-    prop_element = root.find(_tag("D", "prop"))
-    props = [prop.tag for prop in prop_element]
+        prop_element = root.find(_tag("D", "prop"))
+        props = [prop.tag for prop in prop_element]
+    else:
+        props = [ _tag("D", "getcontenttype"),
+            _tag("D", "resourcetype"),
+            _tag("D", "displayname"),
+            _tag("D", "owner"),
+            _tag("D", "getetag"),
+            _tag("CS", "getctag") ]
 
     # Writing answer
     multistatus = ET.Element(_tag("D", "multistatus"))