Skip to content

Commit

Permalink
Transfer returned checksum values (#1719)
Browse files Browse the repository at this point in the history
Checksums were missing from multipart uploads.
  • Loading branch information
klauspost authored Oct 26, 2022
1 parent fbe9d3e commit b6c32fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api-datatypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ type UploadInfo struct {
ExpirationRuleID string

// Verified checksum values, if any.
// Values are base64 (standard) encoded.
// For multipart objects this is a checksum of the checksum of each part.
ChecksumCRC32 string
ChecksumCRC32C string
ChecksumSHA1 string
Expand Down
5 changes: 5 additions & 0 deletions api-put-object-multipart.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,5 +448,10 @@ func (c *Client) completeMultipartUpload(ctx context.Context, bucketName, object
Location: completeMultipartUploadResult.Location,
Expiration: expTime,
ExpirationRuleID: ruleID,

ChecksumSHA256: completeMultipartUploadResult.ChecksumSHA256,
ChecksumSHA1: completeMultipartUploadResult.ChecksumSHA1,
ChecksumCRC32: completeMultipartUploadResult.ChecksumCRC32,
ChecksumCRC32C: completeMultipartUploadResult.ChecksumCRC32C,
}, nil
}

0 comments on commit b6c32fc

Please sign in to comment.