mirror of
https://github.com/pgsty/minio.git
synced 2026-10-07 02:05:58 +03:00
Remove duplicate checkPutObjectArgs in PutObject and (#7396)
Fixes #7384
This commit is contained in:
committed by
Harshavardhana
parent
502456db91
commit
d9a7f80f68
+2
-6
@@ -116,7 +116,7 @@ func (xl xlObjects) CopyObject(ctx context.Context, srcBucket, srcObject, dstBuc
|
||||
}
|
||||
|
||||
putOpts := ObjectOptions{ServerSideEncryption: dstOpts.ServerSideEncryption, UserDefined: srcInfo.UserDefined}
|
||||
return xl.putObject(ctx, dstBucket, dstObject, srcInfo.PutObjReader, putOpts)
|
||||
return xl.PutObject(ctx, dstBucket, dstObject, srcInfo.PutObjReader, putOpts)
|
||||
}
|
||||
|
||||
// GetObjectNInfo - returns object info and an object
|
||||
@@ -510,6 +510,7 @@ func (xl xlObjects) PutObject(ctx context.Context, bucket string, object string,
|
||||
return objInfo, err
|
||||
}
|
||||
defer objectLock.Unlock()
|
||||
|
||||
return xl.putObject(ctx, bucket, object, data, opts)
|
||||
}
|
||||
|
||||
@@ -560,11 +561,6 @@ func (xl xlObjects) putObject(ctx context.Context, bucket string, object string,
|
||||
return dirObjectInfo(bucket, object, data.Size(), opts.UserDefined), nil
|
||||
}
|
||||
|
||||
// Validate put object input args.
|
||||
if err = checkPutObjectArgs(ctx, bucket, object, xl, data.Size()); err != nil {
|
||||
return ObjectInfo{}, err
|
||||
}
|
||||
|
||||
// Validate input data size and it can never be less than zero.
|
||||
if data.Size() < -1 {
|
||||
logger.LogIf(ctx, errInvalidArgument)
|
||||
|
||||
Reference in New Issue
Block a user