Skip to content

Commit 4cf7ef4

Browse files
authored
Merge pull request #736 from PaulHax/fix-content-range
fix(cachedStreamFetcher): avoid double download
2 parents 3f9eb8a + 36ce276 commit 4cf7ef4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/core/streaming/cachedStreamFetcher.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ export class CachedStreamFetcher implements Fetcher {
235235
.then((result) => {
236236
if (!result.done) {
237237
this.chunks.push(result.value);
238+
} else if (this.contentLength === null) {
239+
// Entire stream finished but had no Content-Length header; treat full cache as total length
240+
this.contentLength = this.size;
238241
}
239242
return result;
240243
})

0 commit comments

Comments
 (0)