@nestjs/platform-fastify 8.0.11 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,18 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ <a name="8.2.0"></a>
7
+ # [8.2.0](https://github.com/nestjs/nest/compare/v8.1.2...v8.2.0) (2021-11-08)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **deps:** update dependency fastify to v3.23.1 ([63113d8](https://github.com/nestjs/nest/commit/63113d8))
13
+ * **platform-fastify:** fix streamable file processing ([365c40b](https://github.com/nestjs/nest/commit/365c40b))
14
+
15
+
16
+ ### Features
17
+
18
+ * **common:** add the ability to set some extra metadata about returned files ([5100573](https://github.com/nestjs/nest/commit/5100573))
@@ -128,6 +128,13 @@ class FastifyAdapter extends http_adapter_1.AbstractHttpAdapter {
128
128
  fastifyReply.status(statusCode);
129
129
  }
130
130
  if (body instanceof common_1.StreamableFile) {
131
+ const streamHeaders = body.getHeaders();
132
+ if (fastifyReply.getHeader('Content-Type') === undefined) {
133
+ fastifyReply.header('Content-Type', streamHeaders.type);
134
+ }
135
+ if (fastifyReply.getHeader('Content-Disposition') === undefined) {
136
+ fastifyReply.header('Content-Disposition', streamHeaders.disposition);
137
+ }
131
138
  body = body.getStream();
132
139
  }
133
140
  return fastifyReply.send(body);
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Nest @platform-express
4
- * Copyright(c) 2017 - 2020 Kamil Mysliwiec
4
+ * Copyright(c) 2017 - 2021 Kamil Mysliwiec
5
5
  * https://nestjs.com
6
6
  * MIT Licensed
7
7
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/platform-fastify",
3
- "version": "8.0.11",
3
+ "version": "8.2.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-fastify)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -17,10 +17,10 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "fastify": "3.22.0",
20
+ "fastify": "3.23.1",
21
21
  "fastify-cors": "6.0.2",
22
22
  "fastify-formbody": "5.1.0",
23
- "light-my-request": "4.5.0",
23
+ "light-my-request": "4.6.0",
24
24
  "middie": "5.3.0",
25
25
  "path-to-regexp": "3.2.0",
26
26
  "tslib": "2.3.1"