Skip to content

Commit

Permalink
fix(proxy): handle responses with no content (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
vushe authored Jul 10, 2023
1 parent 6d88dc4 commit fb9e3e3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/utils/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ export async function sendProxy(
}

// Send as stream
for await (const chunk of response.body as any as AsyncIterable<Uint8Array>) {
event.node.res.write(chunk);
if (response.body) {
for await (const chunk of response.body as any as AsyncIterable<Uint8Array>) {
event.node.res.write(chunk);
}
}
return event.node.res.end();
}
Expand Down

0 comments on commit fb9e3e3

Please sign in to comment.