balena-request
Advanced tools
Comparing version 11.0.3 to 11.0.4-node-fix-body-overwrite-432ee302c8c55e629f4915146d4d1c7388d6b01b
@@ -174,3 +174,9 @@ "use strict"; | ||
const body = yield utils.getBody(response, options.responseFormat); | ||
response = Object.assign(Object.assign({}, response), { body }); | ||
// We have to use Object.defineProperty in order to overwrite the body property | ||
// for node-fetch without losing all the other properties/methods | ||
Object.defineProperty(response, 'body', { | ||
get() { | ||
return body; | ||
}, | ||
}); | ||
if (utils.isErrorCode(response.statusCode)) { | ||
@@ -177,0 +183,0 @@ const responseError = utils.getErrorMessageFromResponse(response); |
@@ -7,2 +7,7 @@ # Change Log | ||
# v11.0.4 | ||
## (2020-07-14) | ||
* Fix body overwriting on nodejs [Pagan Gazzard] | ||
# v11.0.3 | ||
@@ -9,0 +14,0 @@ ## (2020-07-13) |
@@ -202,3 +202,9 @@ /* | ||
const body = await utils.getBody(response, options.responseFormat); | ||
response = { ...response, body }; | ||
// We have to use Object.defineProperty in order to overwrite the body property | ||
// for node-fetch without losing all the other properties/methods | ||
Object.defineProperty(response, 'body', { | ||
get() { | ||
return body; | ||
}, | ||
}); | ||
@@ -205,0 +211,0 @@ if (utils.isErrorCode(response.statusCode)) { |
{ | ||
"name": "balena-request", | ||
"version": "11.0.3", | ||
"version": "11.0.4-node-fix-body-overwrite-432ee302c8c55e629f4915146d4d1c7388d6b01b", | ||
"description": "Balena HTTP client", | ||
@@ -5,0 +5,0 @@ "main": "build/request.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
166571
1870
1