Code Repositories xandikos / 7ae6ecd
Properly handle deleted items in sync-collection. When returning deleted items as part of a sync-collection REPORT, implement the behaviour described in RFC6578, section 3.2: For members that have been removed, the DAV:response MUST contain one DAV:status with a value set to '404 Not Found' and MUST NOT contain any DAV:propstat element. This hopefully addresses #92 Jelmer Vernooń≥ 5 months ago
1 changed file(s) with 5 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
9999 diff_iter = itertools.islice(diff_iter, nresults)
100100
101101 for (name, old_resource, new_resource) in diff_iter:
102 propstat = []
102 subhref = urllib.parse.urljoin(
103 webdav.ensure_trailing_slash(href), name)
103104 if new_resource is None:
104 for prop in requested:
105 propstat.append(
106 webdav.PropStatus('404 Not Found', None,
107 ET.Element(prop.tag)))
105 yield webdav.Status(subhref, status='404 Not Found')
108106 else:
107 propstat = []
109108 for prop in requested:
110109 if old_resource is not None:
111110 old_propstat = webdav.get_property_from_element(
116115 href, new_resource, properties, environ, prop)
117116 if old_propstat != new_propstat:
118117 propstat.append(new_propstat)
119 yield webdav.Status(
120 urllib.parse.urljoin(webdav.ensure_trailing_slash(href), name),
121 propstat=propstat)
118 yield webdav.Status(subhref, propstat=propstat)
122119 yield SyncToken(new_token)
123120
124121