mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -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()
|
defer gr.Close()
|
||||||
srcInfo := gr.ObjInfo
|
srcInfo := gr.ObjInfo
|
||||||
|
|
||||||
actualPartSize := srcInfo.Size
|
actualPartSize, err := srcInfo.GetActualSize()
|
||||||
if _, ok := crypto.IsEncrypted(srcInfo.UserDefined); ok {
|
if err != nil {
|
||||||
actualPartSize, err = srcInfo.GetActualSize()
|
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
|
||||||
if err != nil {
|
return
|
||||||
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL, guessIsBrowserReq(r))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := enforceBucketQuota(ctx, dstBucket, actualPartSize); err != nil {
|
if err := enforceBucketQuota(ctx, dstBucket, actualPartSize); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user