Jelajahi Sumber

Use NOT_FOUND instead of GONE

Thunderbird doesn't recognize the status code correctly and shows an synchronization error.
Unrud 9 tahun lalu
induk
melakukan
ff2b8f6e5c
1 mengubah file dengan 2 tambahan dan 4 penghapusan
  1. 2 4
      radicale/__init__.py

+ 2 - 4
radicale/__init__.py

@@ -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