api: Sent ErrPreconditionFailed on If-Match failure (#2009)

* api: Sent ErrPreconditionFailed on If-Match failure

ref:
http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ErrorCodeList

* tests: Added functional tests for GetObject w/ If-Match headers set

* tests: Used verifyError to simplify errorCode and description matching on error
This commit is contained in:
Krishnan Parthasarathi
2016-06-28 01:18:18 -07:00
committed by Harshavardhana
parent 76f6533f8d
commit a854e8cc5c
3 changed files with 78 additions and 1 deletions
+1 -1
View File
@@ -242,7 +242,7 @@ func checkETag(w http.ResponseWriter, r *http.Request) bool {
delete(h, "Content-Type")
delete(h, "Content-Length")
delete(h, "Content-Range")
w.WriteHeader(http.StatusPreconditionFailed)
writeErrorResponse(w, r, ErrPreconditionFailed, r.URL.Path)
return true
}
}