From f72b065d8a9592e246cd32cbc3402fb2a2453b5c Mon Sep 17 00:00:00 2001 From: Unrud Date: Sun, 17 Sep 2017 14:04:00 +0200 Subject: [PATCH] Remove DAV:getetag and DAV:getlastmodified from non-leaf collections --- radicale/xmlutils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/radicale/xmlutils.py b/radicale/xmlutils.py index 50f5763..0b27f83 100644 --- a/radicale/xmlutils.py +++ b/radicale/xmlutils.py @@ -894,9 +894,15 @@ def _propfind_response(base_prefix, path, item, props, user, write=False, element = ET.Element(tag) is404 = False if tag == _tag("D", "getetag"): - element.text = item.etag + if not is_collection or is_leaf: + element.text = item.etag + else: + is404 = True elif tag == _tag("D", "getlastmodified"): - element.text = item.last_modified + if not is_collection or is_leaf: + element.text = item.last_modified + else: + is404 = True elif tag == _tag("D", "principal-collection-set"): tag = ET.Element(_tag("D", "href")) tag.text = _href(base_prefix, "/")