fix(dav): Principal-PROPFIND liefert calendars/ + addressbooks/ Container bei Depth 1
DAVx5 brauchte Kind-Container unter /dav/<user>/ - sonst blieben die Listen nach Aktualisieren leer. Die Home-Sets bleiben getrennt (calendar-home-set vs addressbook-home-set), aber der Principal zeigt beide Sub-Container jetzt explizit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
24a6015841
commit
230c83f124
|
|
@ -269,13 +269,24 @@ def propfind(subpath=''):
|
||||||
multistatus.append(_principal_response(user))
|
multistatus.append(_principal_response(user))
|
||||||
return _xml_response(multistatus)
|
return _xml_response(multistatus)
|
||||||
|
|
||||||
# /dav/<username>/ : principal only (no child collections in this listing
|
# /dav/<username>/ : principal itself + the two sub-containers as
|
||||||
# so clients don't mix calendars and addressbooks). Clients follow
|
# collection children (calendars/ and addressbooks/). The actual
|
||||||
# calendar-home-set / addressbook-home-set for the actual lists.
|
# calendar/addressbook lists live under those home-sets.
|
||||||
if len(parts) == 1:
|
if len(parts) == 1:
|
||||||
if parts[0] != user.username:
|
if parts[0] != user.username:
|
||||||
return Response('', 403)
|
return Response('', 403)
|
||||||
multistatus.append(_principal_response(user))
|
multistatus.append(_principal_response(user))
|
||||||
|
if depth != '0':
|
||||||
|
for (sub, dn) in (('calendars', 'Kalender'), ('addressbooks', 'Adressbücher')):
|
||||||
|
container = ET.Element(_qn('d', 'response'))
|
||||||
|
ET.SubElement(container, _qn('d', 'href')).text = f'/dav/{user.username}/{sub}/'
|
||||||
|
propstat = ET.SubElement(container, _qn('d', 'propstat'))
|
||||||
|
prop = ET.SubElement(propstat, _qn('d', 'prop'))
|
||||||
|
rt = ET.SubElement(prop, _qn('d', 'resourcetype'))
|
||||||
|
ET.SubElement(rt, _qn('d', 'collection'))
|
||||||
|
ET.SubElement(prop, _qn('d', 'displayname')).text = dn
|
||||||
|
ET.SubElement(propstat, _qn('d', 'status')).text = 'HTTP/1.1 200 OK'
|
||||||
|
multistatus.append(container)
|
||||||
return _xml_response(multistatus)
|
return _xml_response(multistatus)
|
||||||
|
|
||||||
# /dav/<username>/calendars/ : only calendar collections
|
# /dav/<username>/calendars/ : only calendar collections
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue