Add part count to checksum (#17035)

This commit is contained in:
Klaus Post
2023-04-14 09:44:45 -07:00
committed by GitHub
parent a9269cee29
commit c133979b8e
3 changed files with 25 additions and 4 deletions

View File

@@ -1137,8 +1137,9 @@ func (er erasureObjects) CompleteMultipartUpload(ctx context.Context, bucket str
}
}
if checksumType.IsSet() {
checksumType |= hash.ChecksumMultipart
cs := hash.NewChecksumFromData(checksumType, checksumCombined)
fi.Checksum = cs.AppendTo(nil)
fi.Checksum = cs.AppendTo(nil, len(fi.Parts))
if opts.EncryptFn != nil {
fi.Checksum = opts.EncryptFn("object-checksum", fi.Checksum)
}