@nestjs/platform-express 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,12 @@
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
+ ### Features
11
+
12
+ * **common:** add the ability to set some extra metadata about returned files ([5100573](https://github.com/nestjs/nest/commit/5100573))
@@ -24,8 +24,12 @@ class ExpressAdapter extends http_adapter_1.AbstractHttpAdapter {
24
24
  return response.send();
25
25
  }
26
26
  if (body instanceof common_1.StreamableFile) {
27
+ const streamHeaders = body.getHeaders();
27
28
  if (response.getHeader('Content-Type') === undefined) {
28
- response.setHeader('Content-Type', 'application/octet-stream');
29
+ response.setHeader('Content-Type', streamHeaders.type);
30
+ }
31
+ if (response.getHeader('Content-Disposition') === undefined) {
32
+ response.setHeader('Content-Disposition', streamHeaders.disposition);
29
33
  }
30
34
  return body.getStream().pipe(response);
31
35
  }
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-express",
3
- "version": "8.0.11",
3
+ "version": "8.2.0",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-express)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -24,8 +24,8 @@
24
24
  "tslib": "2.3.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@nestjs/common": "8.0.11",
28
- "@nestjs/core": "8.0.11"
27
+ "@nestjs/common": "8.2.0",
28
+ "@nestjs/core": "8.2.0"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@nestjs/common": "^8.0.0",