Remove DAV:getetag and DAV:getlastmodified from non-leaf collections

This commit is contained in:
Unrud 2017-09-17 14:04:00 +02:00
parent 99133a3476
commit f72b065d8a

View File

@ -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"):
if not is_collection or is_leaf:
element.text = item.etag
else:
is404 = True
elif tag == _tag("D", "getlastmodified"):
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, "/")