@nestjs/platform-express 9.3.1 → 9.3.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.
@@ -49,6 +49,12 @@ class ExpressAdapter extends http_adapter_1.AbstractHttpAdapter {
49
49
  }
50
50
  });
51
51
  }
52
+ if (response.getHeader('Content-Type') !== undefined &&
53
+ response.getHeader('Content-Type') !== 'application/json' &&
54
+ (body === null || body === void 0 ? void 0 : body.statusCode) >= common_1.HttpStatus.BAD_REQUEST) {
55
+ this.logger.warn("Content-Type doesn't match Reply body, you might need a custom ExceptionFilter for non-JSON responses");
56
+ response.setHeader('Content-Type', 'application/json');
57
+ }
52
58
  return (0, shared_utils_1.isObject)(body) ? response.json(body) : response.send(String(body));
53
59
  }
54
60
  status(response, statusCode) {
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /*
3
3
  * Nest @platform-express
4
- * Copyright(c) 2017 - 2022 Kamil Mysliwiec
4
+ * Copyright(c) 2017 - 2023 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": "9.3.1",
3
+ "version": "9.3.2",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@platform-express)",
5
5
  "author": "Kamil Mysliwiec",
6
6
  "license": "MIT",
@@ -21,11 +21,11 @@
21
21
  "cors": "2.8.5",
22
22
  "express": "4.18.2",
23
23
  "multer": "1.4.4-lts.1",
24
- "tslib": "2.4.1"
24
+ "tslib": "2.5.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@nestjs/common": "9.3.1",
28
- "@nestjs/core": "9.3.1"
27
+ "@nestjs/common": "9.3.2",
28
+ "@nestjs/core": "9.3.2"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@nestjs/common": "^9.0.0",