Maybe I misunderstand the RFC, but this properties are related to a principal collection. DAVdroid without preemptive authentication doesn't like this and tries to create calendars and addressbooks in /.
This commit is contained in:
Unrud 2016-08-13 00:17:50 +02:00 committed by GitHub
parent 2e29b0a21c
commit cf4a6ef749

View File

@ -577,7 +577,11 @@ def _propfind_response(path, item, props, user, write=False):
tag = ET.Element(_tag("D", "href"))
tag.text = _href(collection, "/")
element.append(tag)
elif tag == _tag("D", "principal-URL") and collection.is_principal:
elif (tag in (_tag("C", "calendar-user-address-set"),
_tag("D", "principal-URL"),
_tag("CR", "addressbook-home-set"),
_tag("C", "calendar-home-set")) and
collection.is_principal):
tag = ET.Element(_tag("D", "href"))
tag.text = _href(collection, path)
element.append(tag)
@ -595,11 +599,7 @@ def _propfind_response(path, item, props, user, write=False):
element.append(comp)
else:
is404 = True
elif tag in (
_tag("D", "current-user-principal"),
_tag("C", "calendar-user-address-set"),
_tag("CR", "addressbook-home-set"),
_tag("C", "calendar-home-set")):
elif tag == _tag("D", "current-user-principal"):
tag = ET.Element(_tag("D", "href"))
tag.text = _href(collection, ("/%s/" % user) if user else "/")
element.append(tag)