Always get the actual object size (#14637)

In bulk ETag decryption, do not rely on the etag to check if it is
encrypted or not to decide if we should set the actual object size in
ObjectInfo. The reason is that multipart objects ETags are not
encrypted.

Always get the actual object size in that case.
This commit is contained in:
Anis Elleuch
2022-03-27 16:54:25 +01:00
committed by GitHub
parent ecfae074dc
commit 908eb57795

View File

@@ -163,6 +163,8 @@ func DecryptETags(ctx context.Context, KMS kms.KMS, objects []ObjectInfo, batchS
if err != nil {
return err
}
objects[i].Size = size
ETag, err := etag.Parse(objects[i].ETag)
if err != nil {
return err
@@ -173,7 +175,6 @@ func DecryptETags(ctx context.Context, KMS kms.KMS, objects []ObjectInfo, batchS
return err
}
ETag = etag.ETag(tag)
objects[i].Size = size
objects[i].ETag = ETag.String()
}
}