Fix s3zip not returning data (#13442)

We do not reliably know the length of compressed data, including headers.

Request until the end-of-stream. Results will still be properly truncated.

Fixes #13441
This commit is contained in:
Klaus Post
2021-10-14 12:37:30 -07:00
committed by GitHub
parent 5e53f767c4
commit 76239fa1ae
3 changed files with 5 additions and 4 deletions

View File

@@ -173,7 +173,8 @@ func (api objectAPIHandlers) getObjectInArchiveFileHandler(ctx context.Context,
var rc io.ReadCloser
if file.UncompressedSize64 > 0 {
rs := &HTTPRangeSpec{Start: file.Offset, End: file.Offset + int64(file.UncompressedSize64) - 1}
// We do not know where the file ends, but the returned reader only returns UncompressedSize.
rs := &HTTPRangeSpec{Start: file.Offset, End: -1}
gr, err := objectAPI.GetObjectNInfo(ctx, bucket, zipPath, rs, nil, readLock, opts)
if err != nil {
writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)