mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
ListObjectParts should return actual size (#20782)
Fixes #20781: ``` λ aws --endpoint-url http://127.0.0.1:9001 s3api list-parts --bucket testbucket --key test.testcompress --upload-id "ZDM0YzUwM2YtZWM1Zi00NWI2LTgxMzYtZTIwMGE3Yjc0Y2Y1LjYyMzgyMmFhLWU2N2QtNGUyYS04NDE1LWUzZDFlZmJmMWUyZHgxNzM0NjI1MjgyMDkyNzY4MDAw" { "Parts": [ { "PartNumber": 1, "LastModified": "2024-12-19T16:47:04.334000+00:00", "ETag": "\"7025f242f56479e06c435c0b500cdbb2\"", "Size": 2002 } ], "ChecksumAlgorithm": "", "Initiator": { "ID": "02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4", "DisplayName": "02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4" }, "Owner": { "DisplayName": "02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4", "ID": "02d6176db174dc93cb1b899f7c6078f08654445fe8cf1b6ce98d8855f66bdbf4" }, "StorageClass": "STANDARD" } ``` (for whatever reason the python script generated a 2002 byte file ;)
This commit is contained in:
parent
06ddd8770e
commit
ddd137d317
@ -1204,6 +1204,10 @@ func (api objectAPIHandlers) ListObjectPartsHandler(w http.ResponseWriter, r *ht
|
||||
listPartsInfo.Parts[i].ETag = tryDecryptETag(objectEncryptionKey, p.ETag, kind == crypto.S3)
|
||||
listPartsInfo.Parts[i].Size = p.ActualSize
|
||||
}
|
||||
} else if _, ok := listPartsInfo.UserDefined[ReservedMetadataPrefix+"compression"]; ok {
|
||||
for i, p := range listPartsInfo.Parts {
|
||||
listPartsInfo.Parts[i].Size = p.ActualSize
|
||||
}
|
||||
}
|
||||
|
||||
response := generateListPartsResponse(listPartsInfo, encodingType)
|
||||
|
Loading…
Reference in New Issue
Block a user