ibm-cloud-sdk-core
Advanced tools
Comparing version 4.0.4 to 4.0.5
@@ -0,1 +1,8 @@ | ||
## [4.0.5](https://github.com/IBM/node-sdk-core/compare/v4.0.4...v4.0.5) (2023-03-01) | ||
### Bug Fixes | ||
* correctly handle empty response bodies ([#239](https://github.com/IBM/node-sdk-core/issues/239)) ([d0c9cb3](https://github.com/IBM/node-sdk-core/commit/d0c9cb37b00adf4493fd46a3ae72123d6f1e33e7)) | ||
## [4.0.4](https://github.com/IBM/node-sdk-core/compare/v4.0.3...v4.0.4) (2023-02-27) | ||
@@ -2,0 +9,0 @@ |
@@ -465,3 +465,7 @@ /* eslint-disable class-methods-use-this */ | ||
function ensureJSONResponseBodyIsObject(response) { | ||
if (typeof response.data !== 'string' || !isJsonMimeType(response.headers['content-type'])) { | ||
// If axios gave us an empty string, it is because the response had an empty body | ||
// which can happen for a HEAD request, etc. Return the empty string in that case | ||
if (typeof response.data !== 'string' || | ||
response.data === '' || | ||
!isJsonMimeType(response.headers['content-type'])) { | ||
return response.data; | ||
@@ -468,0 +472,0 @@ } |
@@ -568,3 +568,7 @@ "use strict"; | ||
function ensureJSONResponseBodyIsObject(response) { | ||
if (typeof response.data !== 'string' || !(0, helper_1.isJsonMimeType)(response.headers['content-type'])) { | ||
// If axios gave us an empty string, it is because the response had an empty body | ||
// which can happen for a HEAD request, etc. Return the empty string in that case | ||
if (typeof response.data !== 'string' || | ||
response.data === '' || | ||
!(0, helper_1.isJsonMimeType)(response.headers['content-type'])) { | ||
return response.data; | ||
@@ -571,0 +575,0 @@ } |
{ | ||
"name": "ibm-cloud-sdk-core", | ||
"version": "4.0.4", | ||
"version": "4.0.5", | ||
"description": "Core functionality to support SDKs generated with IBM's OpenAPI SDK Generator.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
1481165
29653