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

@@ -139,7 +139,7 @@ func (f *FakeBackend) Read(ctx context.Context, key string) (ObjectInfo, io.Read
f.mu.Lock()
f.Reads = append(f.Reads, FakeReadCall{Key: normalizedKey})
f.mu.Unlock()
return ObjectInfo{Key: obj.Key, Size: int64(len(obj.Data)), ETag: obj.ETag, LastModified: obj.LastModified}, io.NopCloser(bytes.NewReader(obj.Data)), nil
return ObjectInfo{Key: obj.Key, Size: int64(len(obj.Data)), SizeKnown: true, ETag: obj.ETag, LastModified: obj.LastModified}, io.NopCloser(bytes.NewReader(obj.Data)), nil
}
// DownloadTo writes one object to a caller-owned destination writer.