Skip to content

Commit

Permalink
fix: heap snapshot file download (#30)
Browse files Browse the repository at this point in the history
* fix: heap snapshot file download

* docs: readme
  • Loading branch information
rafaelcr authored Aug 19, 2024
1 parent 422294c commit 800982b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Please see each tool's source directory for additional documentation
* Node.js signal handlers that provide a way to shut down long-running application components
gracefully on unhandled exceptions or interrupt signals.

### CPU Profiler
### Profiler server

* Fastify server that controls a profiler capable of generating:
* `.cpuprofile` files for CPU usage analysis
Expand Down
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 800982b

Please sign in to comment.