Skip to content

Commit

Permalink
[fix] handle Uint8Array output in adapter-node endpoints (#1875)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Jul 11, 2021
1 parent 0db0889 commit 463199c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/cool-ducks-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-node': patch
---

Handle Uint8Array bodies from endpoints
3 changes: 2 additions & 1 deletion packages/adapter-node/src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export function createServer({ render }) {

if (rendered) {
res.writeHead(rendered.status, rendered.headers);
res.end(rendered.body);
if (rendered.body) res.write(rendered.body);
res.end();
} else {
res.statusCode = 404;
res.end('Not found');
Expand Down

0 comments on commit 463199c

Please sign in to comment.