mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
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:
parent
1bf80a6eea
commit
9a2102f5ed
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user