From 7203d93fb3210fa6c1365e7880b1a2c6139cd2ba Mon Sep 17 00:00:00 2001 From: Klaus Post Date: Fri, 1 Oct 2021 11:01:42 -0700 Subject: [PATCH] fs+cache: Remove compression tag (#13346) Remove compression indication from cached data. Fixes #13342 --- cmd/disk-cache-backend.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/disk-cache-backend.go b/cmd/disk-cache-backend.go index 92d5d1f24..d81d17ca2 100644 --- a/cmd/disk-cache-backend.go +++ b/cmd/disk-cache-backend.go @@ -938,6 +938,11 @@ func (c *diskCache) Get(ctx context.Context, bucket, object string, rs *HTTPRang 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. if HasSuffix(object, SlashSeparator) { // 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) return gr, numHits, gerr } - fn, off, length, nErr := NewGetObjectReader(rs, objInfo, opts) if nErr != nil { return nil, numHits, nErr