We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
JSON.parse
json
1 parent 6e55915 commit cf0b038Copy full SHA for cf0b038
src/http.js
@@ -69,7 +69,7 @@ export default async function http(url, request = {}) {
69
export const shouldDownloadAsText = (contentType = '') => /(json|xml|yaml|text)\b/.test(contentType)
70
71
function parseBody(body, contentType) {
72
- if (contentType === 'application/json') {
+ if (contentType && (contentType.indexOf('application/json') === 0 || contentType.indexOf('+json') > 0)) {
73
return JSON.parse(body)
74
}
75
return jsYaml.safeLoad(body)
0 commit comments