Skip to content

Commit

Permalink
fix: heap snapshot file download
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Aug 19, 2024
1 parent 422294c commit 874769f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/profiler/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ const CpuProfiler: FastifyPluginCallback<Record<never, never>, Server, TypeBoxTy
logger.info(
`[HeapProfiler] Completed, total snapshot byte size: ${result.totalSnapshotByteSize}`
);
await pipeline(fs.createReadStream(tmpFile), res.raw);
await res.headers({
'Cache-Control': 'no-store',
'Transfer-Encoding': 'chunked',
'Content-Disposition': `attachment; filename="${filename}"`,
'Content-Type': 'application/json; charset=utf-8',
});
await pipeline(fs.createReadStream(tmpFile), res.raw);
} finally {
const session = existingSession;
existingSession = undefined;
Expand Down

0 comments on commit 874769f

Please sign in to comment.