Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardo-devis-agullo committed Feb 28, 2025
1 parent 40638a5 commit fb019df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/registry/routes/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export default function component(
res.set(result.headers);
}

res.status(result.status);
const streamEnabled =
!!result.response.data?.component?.props?.[stream];
if (streamEnabled) {
Expand All @@ -59,6 +58,7 @@ export default function component(

const nodeStream = Readable.from(webStream);

res.status(result.status);
nodeStream.on('error', (err) => {
res.status(500).end(String(err));
});
Expand All @@ -69,7 +69,7 @@ export default function component(
res.end();
});
} else {
res.json(result.response);
res.status(result.status).json(result.response);
}
} catch (e) {
res.status(500).json({
Expand Down

0 comments on commit fb019df

Please sign in to comment.