cob_spec
cob_spec copied to clipboard
Add test to check when etag doesn't match file
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.
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.
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?