http-proxy-middleware 1.3.0 → 1.3.1

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [v1.3.1](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.3.1)
4
+
5
+ - fix(fix-request-body): make sure the content-type exists ([#578](https://github.com/chimurai/http-proxy-middleware/pull/578)) ([oufeng](https://github.com/oufeng))
6
+
3
7
  ## [v1.3.0](https://github.com/chimurai/http-proxy-middleware/releases/tag/v1.3.0)
4
8
 
5
9
  - docs(response interceptor): align with nodejs default utf8 ([#567](https://github.com/chimurai/http-proxy-middleware/pull/567))
@@ -15,7 +15,7 @@ function fixRequestBody(proxyReq, req) {
15
15
  proxyReq.setHeader('Content-Length', Buffer.byteLength(bodyData));
16
16
  proxyReq.write(bodyData);
17
17
  };
18
- if (contentType.includes('application/json')) {
18
+ if (contentType && contentType.includes('application/json')) {
19
19
  writeBody(JSON.stringify(req.body));
20
20
  }
21
21
  if (contentType === 'application/x-www-form-urlencoded') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "http-proxy-middleware",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "The one-liner node.js proxy middleware for connect, express and browser-sync",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",