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

Jelmer Vernoo─│ jelmer at jelmer.uk
Sun Jan 24 08:40:08 PST 2016


On Sun, Jan 24, 2016 at 09:58:20AM +0100, Guido G├╝nther wrote:
> 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)

LGTM

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://keithp.com/pipermail/calypso/attachments/20160124/fe96ab55/attachment.sig>


More information about the Calypso mailing list