Skip to content

Commit fb9e3e3

Browse files
authored
fix(proxy): handle responses with no content (#433)
1 parent 6d88dc4 commit fb9e3e3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/utils/proxy.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,10 @@ export async function sendProxy(
134134
}
135135

136136
// Send as stream
137-
for await (const chunk of response.body as any as AsyncIterable<Uint8Array>) {
138-
event.node.res.write(chunk);
137+
if (response.body) {
138+
for await (const chunk of response.body as any as AsyncIterable<Uint8Array>) {
139+
event.node.res.write(chunk);
140+
}
139141
}
140142
return event.node.res.end();
141143
}

0 commit comments

Comments
 (0)