|
|
@ -202,11 +202,16 @@ export async function fetch(
|
|
|
|
start: (controller) => {
|
|
|
|
start: (controller) => {
|
|
|
|
streamChannel.onmessage = (res: StreamMessage) => {
|
|
|
|
streamChannel.onmessage = (res: StreamMessage) => {
|
|
|
|
// close early if aborted
|
|
|
|
// close early if aborted
|
|
|
|
if (signal?.aborted) controller.error(ERROR_REQUEST_CANCELLED)
|
|
|
|
if (signal?.aborted) {
|
|
|
|
|
|
|
|
controller.error(ERROR_REQUEST_CANCELLED)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!res.bytes.length) {
|
|
|
|
if (!res.bytes.length) {
|
|
|
|
controller.close()
|
|
|
|
controller.close()
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
controller.enqueue(res)
|
|
|
|
controller.enqueue(res)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|