Remove checksums from HTTP range request, add part checksums (#17105)

This commit is contained in:
Klaus Post
2023-04-28 08:26:32 -07:00
committed by GitHub
parent 6e27264c6b
commit 7fad0c8b41
7 changed files with 57 additions and 17 deletions

View File

@@ -1124,7 +1124,8 @@ func (o *ObjectInfo) metadataEncryptFn(headers http.Header) (objectMetaEncryptFn
}
// decryptChecksums will attempt to decode checksums and return it/them if set.
func (o *ObjectInfo) decryptChecksums() map[string]string {
// if part > 0, and we have the checksum for the part that will be returned.
func (o *ObjectInfo) decryptChecksums(part int) map[string]string {
data := o.Checksum
if len(data) == 0 {
return nil
@@ -1137,5 +1138,5 @@ func (o *ObjectInfo) decryptChecksums() map[string]string {
}
data = decrypted
}
return hash.ReadCheckSums(data)
return hash.ReadCheckSums(data, part)
}