Skip to content

Commit 84c6ce5

Browse files
committed
check response status 206
1 parent 9ad6dbe commit 84c6ce5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/get/worker/DownloadWorker.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ export class DownloadWorker {
2626
},
2727
signal
2828
})
29-
if (!response.ok) {
29+
30+
// if (!response.ok) {
31+
// controller.abort()
32+
// throw new Error(`Failed to download at range ${range[0]}-${range[1]}`)
33+
// }
34+
35+
if (response.status !== 206) {
3036
controller.abort()
31-
throw new Error(`Failed to download at range ${range[0]}-${range[1]}`)
37+
throw new Error(`HTTP status not 206 at range ${range[0]}-${range[1]}`)
3238
}
3339

3440
const blob = await response.blob()

0 commit comments

Comments
 (0)