[Calypso] [PATCH] Return 404 when trying to delete a non existing item

Guido G√ľnther agx at sigxcpu.org
Sun Jan 24 00:58:20 PST 2016


Found by caldav-testers CalDAV/delete.xml
---
 calypso/__init__.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/calypso/__init__.py b/calypso/__init__.py
index ba53288..9c02114 100644
--- a/calypso/__init__.py
+++ b/calypso/__init__.py
@@ -341,6 +341,10 @@ class CollectionHTTPHandler(server.BaseHTTPRequestHandler):
                 self.send_header("Content-Type", "text/xml")
                 self.end_headers()
                 self.wfile.write(self._answer)
+            elif not item:
+                # Item does not exist
+                self.send_calypso_response(client.NOT_FOUND, 0)
+                self.end_headers()
             else:
                 # No item or ETag precondition not verified, do not delete item
                 self.send_calypso_response(client.PRECONDITION_FAILED, 0)
-- 
2.7.0.rc3



More information about the Calypso mailing list