mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Ignore copy conditions when ETag is not available (#2888)
This commit is contained in:
parent
4560cbc20c
commit
57f75b1d9b
@ -80,7 +80,7 @@ func checkCopyObjectPreconditions(w http.ResponseWriter, r *http.Request, objInf
|
|||||||
// same as the one specified; otherwise return a 412 (precondition failed).
|
// same as the one specified; otherwise return a 412 (precondition failed).
|
||||||
ifMatchETagHeader := r.Header.Get("x-amz-copy-source-if-match")
|
ifMatchETagHeader := r.Header.Get("x-amz-copy-source-if-match")
|
||||||
if ifMatchETagHeader != "" {
|
if ifMatchETagHeader != "" {
|
||||||
if !isETagEqual(objInfo.MD5Sum, ifMatchETagHeader) {
|
if objInfo.MD5Sum != "" && !isETagEqual(objInfo.MD5Sum, ifMatchETagHeader) {
|
||||||
// If the object ETag does not match with the specified ETag.
|
// If the object ETag does not match with the specified ETag.
|
||||||
writeHeaders()
|
writeHeaders()
|
||||||
writeErrorResponse(w, r, ErrPreconditionFailed, r.URL.Path)
|
writeErrorResponse(w, r, ErrPreconditionFailed, r.URL.Path)
|
||||||
@ -92,7 +92,7 @@ func checkCopyObjectPreconditions(w http.ResponseWriter, r *http.Request, objInf
|
|||||||
// one specified otherwise, return a 304 (not modified).
|
// one specified otherwise, return a 304 (not modified).
|
||||||
ifNoneMatchETagHeader := r.Header.Get("x-amz-copy-source-if-none-match")
|
ifNoneMatchETagHeader := r.Header.Get("x-amz-copy-source-if-none-match")
|
||||||
if ifNoneMatchETagHeader != "" {
|
if ifNoneMatchETagHeader != "" {
|
||||||
if isETagEqual(objInfo.MD5Sum, ifNoneMatchETagHeader) {
|
if objInfo.MD5Sum != "" && isETagEqual(objInfo.MD5Sum, ifNoneMatchETagHeader) {
|
||||||
// If the object ETag matches with the specified ETag.
|
// If the object ETag matches with the specified ETag.
|
||||||
writeHeaders()
|
writeHeaders()
|
||||||
writeErrorResponse(w, r, ErrPreconditionFailed, r.URL.Path)
|
writeErrorResponse(w, r, ErrPreconditionFailed, r.URL.Path)
|
||||||
|
Loading…
Reference in New Issue
Block a user