Skip to content

Commit 2629191

Browse files
committed
fixup! pull
1 parent b8353ac commit 2629191

File tree

1 file changed

+6
-4
lines changed
  • packages/open-next/src/core/routing

1 file changed

+6
-4
lines changed

packages/open-next/src/core/routing/util.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ export function convertRes(res: OpenNextNodeResponse): InternalResult {
106106
isBinaryContentType(headers["content-type"]) ||
107107
!!headers["content-encoding"];
108108
const body = new ReadableStream({
109-
start(controller) {
110-
for (const chunk of res._chunks ?? []) {
111-
controller.enqueue(chunk);
109+
pull(controller) {
110+
if (!res._chunks || res._chunks.length === 0) {
111+
controller.close();
112+
return;
112113
}
113-
controller.close();
114+
115+
controller.enqueue(res._chunks.shift());
114116
},
115117
});
116118
return {

0 commit comments

Comments
 (0)