@nestjs/platform-fastify 8.1.1 → 8.2.2

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))
package/Readme.md CHANGED
@@ -113,6 +113,8 @@ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors
113
113
  <td align="center" valign="middle"><a href="https://studyclerk.com/pay-for-research-paper" target="_blank"><img src="https://nestjs.com/img/studyclerk-logo.png" width="125" valign="middle" /></a></td><td align="center" valign="middle"><a href="https://xyndata.com" target="_blank"><img src="https://nestjs.com/img/xyndata-logo.png" width="125" valign="middle" /></a></td></tr><tr>
114
114
  <td align="center" valign="middle"><a href="https://www.anonymistic.com/" target="_blank"><img src="https://nestjs.com/img/anonymistic-logo.png" width="125" valign="middle" /></a></td>
115
115
  <td align="center" valign="middle"><a href="https://www.naologic.com/" target="_blank"><img src="https://nestjs.com/img/naologic-logo.svg" width="125" valign="middle" /></a></td>
116
+ <td align="center" valign="middle"><a href="https://messaged.com/" target="_blank"><img src="https://nestjs.com/img/messaged-logo.png" width="50" valign="middle" /></a></td>
117
+ <td align="center" valign="middle"><a href="https://triplecore.io" target="_blank"><img src="https://nestjs.com/img/triplecore-logo.svg" width="50" valign="middle" /></a></td>
116
118
  </tr></table>
117
119
 
118
120
  ## Backers
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/platform-fastify",
3
- "version": "8.1.1",
3
+ "version": "8.2.2",
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.24.0",
21
21
  "fastify-cors": "6.0.2",
22
- "fastify-formbody": "5.1.0",
23
- "light-my-request": "4.5.0",
22
+ "fastify-formbody": "5.2.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"