Use 403 response for supported-report and valid-sync-token errors

Some clients don't handle 409
This commit is contained in:
Unrud 2020-05-24 13:30:20 +02:00
parent e63a6e0c85
commit 7ed5122636

View File

@ -59,7 +59,7 @@ def xml_report(base_prefix, path, xml_request, collection, encoding,
collection.get_meta("tag") not in ("VADDRESSBOOK", "VCALENDAR")):
logger.warning("Invalid REPORT method %r on %r requested",
xmlutils.make_human_tag(root.tag), path)
return (client.CONFLICT,
return (client.FORBIDDEN,
xmlutils.webdav_error("D:supported-report"))
prop_element = root.find(xmlutils.make_clark("D:prop"))
props = (
@ -92,7 +92,8 @@ def xml_report(base_prefix, path, xml_request, collection, encoding,
# Invalid sync token
logger.warning("Client provided invalid sync token %r: %s",
old_sync_token, e, exc_info=True)
return (client.CONFLICT,
# client.CONFLICT doesn't work with some clients (e.g. InfCloud)
return (client.FORBIDDEN,
xmlutils.webdav_error("D:valid-sync-token"))
hreferences = (pathutils.unstrip_path(
posixpath.join(collection.path, n)) for n in names)