Merge d3bab98390d231be1f181a6a3f2538e1a2c841c1 into 4d38424e6cbb32d07c74d3b4d760af7afb35742d

This commit is contained in:
Aaron Eppert 2025-03-20 11:59:08 +02:00 committed by GitHub
commit 2f539e3698
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -362,7 +362,14 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (io.ReadClo
if err != nil {
return nil, err
}
o.bytes = *bytes
if bytes == nil {
// Must set these as "defaults" since the HTTP payload is compressed and the handler will decompress by default,
// otherwise we end up with a file size and hash mismatch
o.bytes = -1
o.md5 = ""
} else {
o.bytes = *bytes
}
return resp.HTTPResponse().Body, nil
}