fix: remove unnecessary replication checks (#21569)

This commit is contained in:
M Alvee
2025-09-08 10:43:13 -07:00
committed by GitHub
parent 07c3a429bf
commit ae71d76901
3 changed files with 6 additions and 9 deletions

View File

@@ -394,9 +394,9 @@ func (er erasureObjects) newMultipartUpload(ctx context.Context, bucket string,
return nil, err
}
// if object doesn't exist and not a replication request return error for If-Match conditional requests
// if object doesn't exist return error for If-Match conditional requests
// If-None-Match should be allowed to proceed for non-existent objects
if err != nil && !opts.ReplicationRequest && opts.HasIfMatch && (isErrObjectNotFound(err) || isErrVersionNotFound(err)) {
if err != nil && opts.HasIfMatch && (isErrObjectNotFound(err) || isErrVersionNotFound(err)) {
return nil, err
}
}
@@ -1118,9 +1118,9 @@ func (er erasureObjects) CompleteMultipartUpload(ctx context.Context, bucket str
return ObjectInfo{}, err
}
// if object doesn't exist and not a replication request return error for If-Match conditional requests
// if object doesn't exist return error for If-Match conditional requests
// If-None-Match should be allowed to proceed for non-existent objects
if err != nil && !opts.ReplicationRequest && opts.HasIfMatch && (isErrObjectNotFound(err) || isErrVersionNotFound(err)) {
if err != nil && opts.HasIfMatch && (isErrObjectNotFound(err) || isErrVersionNotFound(err)) {
return ObjectInfo{}, err
}
}