From 53a7e158335ef1eb90800bd22981d65b2f3d0828 Mon Sep 17 00:00:00 2001 From: Unrud Date: Fri, 10 Mar 2017 22:19:10 +0100 Subject: [PATCH] Return empty result for unsupported report methods --- radicale/xmlutils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index d7162f4..2a44041 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -820,6 +820,16 @@ def report(base_prefix, path, xml_request, collection): """ root = ET.fromstring(xml_request.encode("utf8")) + if root.tag in ( + _tag("D", "principal-search-property-set"), + _tag("D", "principal-property-search"), + _tag("D", "expand-property")): + # We don't support searching for principals or indirect retrieving of + # properties, just return an empty result. + # InfCloud asks for expand-property reports (even if we don't announce + # support for them) and stops working if an error code is returned. + collection.logger.warning("Unsupported report method: %s", root.tag) + return _pretty_xml(ET.Element(_tag("D", "multistatus"))) prop_element = root.find(_tag("D", "prop")) props = ( [prop.tag for prop in prop_element]