@jnode/request 1.1.1 → 1.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnode/request",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Simple HTTP(s) package for Node.js.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -30,7 +30,7 @@ function request(method, url, headers = {}, body) {
30
30
  headers: headers
31
31
  }, (res) => {
32
32
  let chunks = [];
33
- res.on('data', chunks.push);
33
+ res.on('data', (chunk) => chunks.push(chunk));
34
34
  res.on('end', () => {
35
35
  resolve(new RequestResponse(res, Buffer.concat(chunks)));
36
36
  });
@@ -78,7 +78,7 @@ async function multipartRequest(method, url, headers, parts, options) {
78
78
  const req = reqModule.request(url, options, (res) => {
79
79
  //save buffers
80
80
  let chunks = [];
81
- res.on('data', chunks.push);
81
+ res.on('data', (chunk) => chunks.push(chunk));
82
82
 
83
83
  res.on('end', () => {
84
84
  resolve(new RequestResponse(res, Buffer.concat(chunks)));