From 9972897d7535449fcbbe39b5b66e02f2c5118440 Mon Sep 17 00:00:00 2001 From: Christoph Polcin Date: Mon, 25 Feb 2013 20:55:15 +0100 Subject: [PATCH] accepts PROPFIND whitout request body --- radicale/xmlutils.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index b03f34b3..e140a275 100644 --- a/radicale/xmlutils.py +++ b/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"))