Fix to cache objects on downloads (#6828)

fixes #6817
This commit is contained in:
poornas 2018-11-19 11:00:46 -08:00 committed by kannappanr
parent ef517bd0da
commit d732b1ff9d

View File

@ -303,7 +303,7 @@ func (c cacheObjects) GetObject(ctx context.Context, bucket, object string, star
}
dcache.Delete(ctx, bucket, object)
}
if startOffset != 0 || length != objInfo.Size {
if startOffset != 0 || (length > 0 && length != objInfo.Size) {
// We don't cache partial objects.
return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts)
}