From e06cfa4de0c01a29f2a7d3a6596f9d74a6f459df Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Fri, 31 Aug 2012 17:21:16 +0200 Subject: [PATCH] Handle "If-None-Match: *" HTTP headers for PUT requests --- radicale/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radicale/__init__.py b/radicale/__init__.py index 060f04fd..3bda1a6b 100644 --- a/radicale/__init__.py +++ b/radicale/__init__.py @@ -474,8 +474,9 @@ class Application(object): # Evolution bug workaround etag = environ.get("HTTP_IF_MATCH", "").replace("\\", "") + match = environ.get("HTTP_IF_NONE_MATCH", "") == "*" if (not item and not etag) or ( - item and ((etag or item.etag) == item.etag)): + item and ((etag or item.etag) == item.etag) and not match): # PUT allowed in 3 cases # Case 1: No item and no ETag precondition: Add new item # Case 2: Item and ETag precondition verified: Modify item