diff --git a/src/utils/proxy.ts b/src/utils/proxy.ts index 03949ca2..2fffe2d3 100644 --- a/src/utils/proxy.ts +++ b/src/utils/proxy.ts @@ -134,8 +134,10 @@ export async function sendProxy( } // Send as stream - for await (const chunk of response.body as any as AsyncIterable) { - event.node.res.write(chunk); + if (response.body) { + for await (const chunk of response.body as any as AsyncIterable) { + event.node.res.write(chunk); + } } return event.node.res.end(); }