Use NOT_FOUND instead of GONE

Thunderbird doesn't recognize the status code correctly and shows an synchronization error.
This commit is contained in:
Unrud 2016-08-31 01:42:43 +02:00
parent 1ea9b1dca9
commit ff2b8f6e5c

View File

@ -54,8 +54,6 @@ NOT_ALLOWED = (client.FORBIDDEN, {"Content-type": "text/plain"},
"Access to the requested resource forbidden.")
NOT_FOUND = (client.NOT_FOUND, {"Content-type": "text/plain"},
"The requested resource could not be found.")
GONE = (client.GONE, {"Content-type": "text/plain"},
"The requested resource is no longer available.")
WEBDAV_PRECONDITION_FAILED = (client.CONFLICT, {"Content-type": "text/plain"},
"WebDAV precondition failed.")
PRECONDITION_FAILED = (client.PRECONDITION_FAILED,
@ -425,7 +423,7 @@ class Application:
if not self._access(user, path, "w", item):
return NOT_ALLOWED
if not item:
return GONE
return NOT_FOUND
if_match = environ.get("HTTP_IF_MATCH", "*")
if if_match not in ("*", item.etag):
# ETag precondition not verified, do not delete item
@ -519,7 +517,7 @@ class Application:
if not self._access(user, to_path, "w", item):
return NOT_ALLOWED
if not item:
return GONE
return NOT_FOUND
if isinstance(item, self.Collection):
return WEBDAV_PRECONDITION_FAILED