W3C home > Mailing lists > Public > ietf-http-wg@w3.org > April to June 2007

Re: If-match clarification

From: Cyrus Daboo <cyrus@daboo.name>
Date: Wed, 20 Jun 2007 17:39:10 -0400
To: Henrik Nordstrom <henrik@henriknordstrom.net>
cc: ietf-http-wg@w3.org
Message-ID: <2B62C36B27EFE32E201B15C5@caldav.corp.apple.com>

Hi Henrik,

--On June 20, 2007 10:44:28 PM +0200 Henrik Nordstrom 
<henrik@henriknordstrom.net> wrote:

>> But what about the case of an etag provided in If-Match against a
>> resource  that no longer exists? Should the server return 404 or 412?
> 404 I would say, at least if it's a GET/HEAD.
> Errors is not normally subject to If-* conditions. If-* conditions only
> applies when the server actually could generate a successful response if
> the condition was not there.
> For PUT 412 is probably more appropriate there as it's the condition
> which prevented the method from being executed, not the fact that the
> resource no longer exists.

Actually I think being able to distinguish between "resource changed" vs 
"resource deleted" on PUT is useful. Consider that a client is likely using 
If-match in order to synchronize its changes with the server. So in the 
case of a "resource changed" the client would give the user three choices 
to fix: overwrite server copy with local copy, overwrite local copy with 
server copy, merge server and local copies. In the case of "resource 
deleted" there would only be two choices: save local copy to server, delete 
local copy. Being able to pick the appropriate course of action based on 
the response code (without the need to do another request to see if the 
resource exists) would be useful.

Cyrus Daboo
Received on Wednesday, 20 June 2007 21:39:37 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 11:10:42 UTC