Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test to check when etag doesn't match file #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hnlee
Copy link
Contributor

@hnlee hnlee commented Sep 30, 2016

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.

@jdesrosiers
Copy link
Contributor

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.

@damonkelley
Copy link
Member

damonkelley commented Mar 2, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants