Comparing version 6.0.2 to 6.0.3
@@ -326,3 +326,3 @@ "use strict"; | ||
*/ | ||
getResponseDataFromContentType(response) { | ||
async getResponseDataFromContentType(response) { | ||
let contentType = response.headers.get('Content-Type'); | ||
@@ -335,3 +335,10 @@ if (contentType === null) { | ||
if (contentType.includes('application/json')) { | ||
return response.json(); | ||
let data = await response.text(); | ||
try { | ||
data = JSON.parse(data); | ||
} | ||
catch (_a) { | ||
// continue | ||
} | ||
return data; | ||
} | ||
@@ -338,0 +345,0 @@ else if (contentType.includes('text/plain') || |
# Changelog | ||
## [6.0.3](https://github.com/googleapis/gaxios/compare/v6.0.2...v6.0.3) (2023-07-24) | ||
### Bug Fixes | ||
* Handle invalid json when Content-Type=application/json ([#558](https://github.com/googleapis/gaxios/issues/558)) ([71602eb](https://github.com/googleapis/gaxios/commit/71602ebc2ab18d5af904b152723756f57fb13bce)) | ||
## [6.0.2](https://github.com/googleapis/gaxios/compare/v6.0.1...v6.0.2) (2023-07-20) | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "gaxios", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "A simple common HTTP client specifically for Google APIs and services.", | ||
@@ -5,0 +5,0 @@ "main": "build/src/index.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
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
78628
799