Skip to content

Commit

Permalink
Fix debug zip
Browse files Browse the repository at this point in the history
  • Loading branch information
miklschmidt committed Sep 30, 2024
1 parent 747eea8 commit 813e0e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/api/debug-zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
res.setHeader('Content-Type', 'application/x-zip');
res.setHeader('Content-Disposition', `attachment; filename=ratos-debug.zip`);
getLogger().info(`Sending zip to client...`);
return res.status(200).send(
zip.generateNodeStream({
return zip
.generateNodeStream({
type: 'nodebuffer',
streamFiles: true,
compression: 'DEFLATE',
compressionOptions: { level: 1 },
}),
);
})
.pipe(res.status(200), { end: true });
} catch (e) {
getLogger().error(e instanceof Error ? e.message : 'Unknown error while generating debug zip');
return res.status(200).json({
Expand Down

0 comments on commit 813e0e7

Please sign in to comment.