Always get actual size in CopyObjectPart (#12466)

Always use `GetActualSize` to get the part size, not just when encrypted.

Fixes mint test io.minio.MinioClient.uploadPartCopy, 
error "Range specified is not valid for source object".
This commit is contained in:
Klaus Post 2021-06-08 18:51:55 +02:00 committed by GitHub
parent 1bf80a6eea
commit 9a2102f5ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2330,13 +2330,10 @@ func (api objectAPIHandlers) CopyObjectPartHandler(w http.ResponseWriter, r *htt
defer gr.Close()
srcInfo := gr.ObjInfo
actualPartSize := srcInfo.Size
if _, ok := crypto.IsEncrypted(srcInfo.UserDefined); ok {
actualPartSize, err = srcInfo.GetActualSize()
if err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
return
}
actualPartSize, err := srcInfo.GetActualSize()
if err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
return
}
if err := enforceBucketQuota(ctx, dstBucket, actualPartSize); err != nil {