Various fixes

This commit is contained in:
Vanilagy
2026-03-06 15:49:24 +01:00
parent 22716b1f83
commit c088a31384
14 changed files with 506 additions and 142 deletions
+1 -21
View File
@@ -641,27 +641,6 @@ export class UrlSource extends Source {
// logic for that has vanished for now. Leaving a comment here if this becomes relevant again.
}
/** @internal */
private _getTotalLengthFromRangeResponse(response: Response) {
const contentRange = response.headers.get('Content-Range');
if (contentRange) {
const match = /\/(\d+)/.exec(contentRange);
if (match) {
return Number(match[1]);
}
}
const contentLength = response.headers.get('Content-Length');
if (contentLength) {
return Number(contentLength);
} else {
throw new Error(
'Partial HTTP response (status 206) must surface either Content-Range or'
+ ' Content-Length header.',
);
}
}
/** @internal */
_dispose() {
this._orchestrator.dispose();
@@ -1847,6 +1826,7 @@ class ReadOrchestrator {
const index = this.workers.indexOf(worker);
assert(index !== -1);
worker.running = false;
this.workers.splice(index, 1);
if (this.fileSize === null) {