Stream object responses with known size bounds

This commit is contained in:
2026-12-01 20:22:42 +00:00
parent da4de023ad
commit d0c879ad09
7 changed files with 191 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ func (b *S3Backend) Read(ctx context.Context, key string) (ObjectInfo, io.ReadCl
lastModified = &t
}
return ObjectInfo{
Key: normalizedKey, Size: valueOrZeroInt64(resp.ContentLength),
Key: normalizedKey, Size: valueOrZeroInt64(resp.ContentLength), SizeKnown: resp.ContentLength != nil,
ETag: strings.Trim(valueOrEmpty(resp.ETag), "\""), LastModified: lastModified,
}, resp.Body, nil
}