Fix PutObject Trailing checksum (#20456)

PutObject would verify trailing checksums, but not store them.

Fixes #20455
This commit is contained in:
Klaus Post
2024-09-19 05:59:07 -07:00
committed by GitHub
parent e1c2344591
commit 05a6c170bf
4 changed files with 21 additions and 5 deletions
+8
View File
@@ -366,6 +366,14 @@ func (r *Reader) ContentCRC() map[string]string {
return map[string]string{r.contentHash.Type.String(): r.contentHash.Encoded}
}
// Checksum returns the content checksum if set.
func (r *Reader) Checksum() *Checksum {
if !r.contentHash.Type.IsSet() || !r.contentHash.Valid() {
return nil
}
return &r.contentHash
}
var _ io.Closer = (*Reader)(nil) // compiler check
// Close and release resources.