cob_spec icon indicating copy to clipboard operation
cob_spec copied to clipboard

Add test to check when etag doesn't match file

Open hnlee opened this issue 8 years ago • 2 comments

Add a test to the current Patch With Etag to handle case when etag doesn't match file. Expected behavior is that server will return 409 response.

hnlee avatar Sep 30 '16 16:09 hnlee

I hate to bump an issue that has been dormant for months, but I wanted to point out that the proper response when ETags don't match is 412 Precondition Failed, not 409 Conflict.

From RFC 5789 https://tools.ietf.org/html/rfc5789

When a client uses either the If-Match or If-Unmodified-Since header to define a precondition, and that precondition failed, then the 412 (Precondition Failed) error is most helpful to the client. However, that response makes no sense if there was no precondition on the request. In cases when the server detects a possible conflicting modification and no precondition was defined in the request, the server can return a 409 (Conflict) response.

jdesrosiers avatar Apr 27 '17 23:04 jdesrosiers

Yeah, it seems like a 412 is more appropriate. @hnlee would you mind changing this, or would it be OK if someone else made the modification?

damonkelley avatar Mar 02 '18 21:03 damonkelley