fs+cache: Remove compression tag (#13346)

Remove compression indication from cached data.

Fixes #13342
This commit is contained in:
Klaus Post 2021-10-01 11:01:42 -07:00 committed by GitHub
parent ffd497673f
commit 7203d93fb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -938,6 +938,11 @@ func (c *diskCache) Get(ctx context.Context, bucket, object string, rs *HTTPRang
rs = nil rs = nil
} }
if objInfo.IsCompressed() {
// Cache isn't compressed.
delete(objInfo.UserDefined, ReservedMetadataPrefix+"compression")
}
// For a directory, we need to send an reader that returns no bytes. // For a directory, we need to send an reader that returns no bytes.
if HasSuffix(object, SlashSeparator) { if HasSuffix(object, SlashSeparator) {
// The lock taken above is released when // The lock taken above is released when
@ -945,7 +950,6 @@ func (c *diskCache) Get(ctx context.Context, bucket, object string, rs *HTTPRang
gr, gerr := NewGetObjectReaderFromReader(bytes.NewBuffer(nil), objInfo, opts) gr, gerr := NewGetObjectReaderFromReader(bytes.NewBuffer(nil), objInfo, opts)
return gr, numHits, gerr return gr, numHits, gerr
} }
fn, off, length, nErr := NewGetObjectReader(rs, objInfo, opts) fn, off, length, nErr := NewGetObjectReader(rs, objInfo, opts)
if nErr != nil { if nErr != nil {
return nil, numHits, nErr return nil, numHits, nErr