We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8353ac commit 2629191Copy full SHA for 2629191
packages/open-next/src/core/routing/util.ts
@@ -106,11 +106,13 @@ export function convertRes(res: OpenNextNodeResponse): InternalResult {
106
isBinaryContentType(headers["content-type"]) ||
107
!!headers["content-encoding"];
108
const body = new ReadableStream({
109
- start(controller) {
110
- for (const chunk of res._chunks ?? []) {
111
- controller.enqueue(chunk);
+ pull(controller) {
+ if (!res._chunks || res._chunks.length === 0) {
+ controller.close();
112
+ return;
113
}
- controller.close();
114
+
115
+ controller.enqueue(res._chunks.shift());
116
},
117
});
118
return {
0 commit comments