mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
fix(platform-fastify): fix streamable file processing
This commit is contained in:
@@ -280,7 +280,6 @@ export class FastifyAdapter<
|
||||
fastifyReply.status(statusCode);
|
||||
}
|
||||
if (body instanceof StreamableFile) {
|
||||
body = body.getStream();
|
||||
const streamHeaders = body.getHeaders();
|
||||
if (fastifyReply.getHeader('Content-Type') === undefined) {
|
||||
fastifyReply.header('Content-Type', streamHeaders.type);
|
||||
@@ -288,6 +287,7 @@ export class FastifyAdapter<
|
||||
if (fastifyReply.getHeader('Content-Disposition') === undefined) {
|
||||
fastifyReply.header('Content-Disposition', streamHeaders.disposition);
|
||||
}
|
||||
body = body.getStream();
|
||||
}
|
||||
return fastifyReply.send(body);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user