@dhis2/app-runtime
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -549,2 +549,5 @@ 'use strict'; | ||
} | ||
const parseContentType = contentType => { | ||
return contentType ? contentType.split(';')[0].trim().toLowerCase() : null; | ||
}; | ||
const parseStatus = async response => { | ||
@@ -588,3 +591,3 @@ if (response.status === 401 || response.status === 403 || response.status === 409) { | ||
}).then(parseStatus).then(async response => { | ||
if (response.headers.get('Content-Type') === 'application/json') { | ||
if (parseContentType(response.headers.get('Content-Type')) === 'application/json') { | ||
return await response.json(); // Will throw if invalid JSON! | ||
@@ -591,0 +594,0 @@ } |
@@ -542,2 +542,5 @@ import React, { useRef, useState, useEffect, useCallback, useContext } from 'react'; | ||
} | ||
const parseContentType = contentType => { | ||
return contentType ? contentType.split(';')[0].trim().toLowerCase() : null; | ||
}; | ||
const parseStatus = async response => { | ||
@@ -581,3 +584,3 @@ if (response.status === 401 || response.status === 403 || response.status === 409) { | ||
}).then(parseStatus).then(async response => { | ||
if (response.headers.get('Content-Type') === 'application/json') { | ||
if (parseContentType(response.headers.get('Content-Type')) === 'application/json') { | ||
return await response.json(); // Will throw if invalid JSON! | ||
@@ -584,0 +587,0 @@ } |
{ | ||
"name": "@dhis2/app-runtime", | ||
"description": "A singular runtime dependency for applications on the DHIS2 platform", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"main": "build/cjs/index.js", | ||
@@ -22,4 +22,4 @@ "module": "build/es/index.js", | ||
"devDependencies": { | ||
"@dhis2/app-service-config": "2.0.0", | ||
"@dhis2/app-service-data": "2.0.0" | ||
"@dhis2/app-service-config": "2.0.1", | ||
"@dhis2/app-service-data": "2.0.1" | ||
}, | ||
@@ -26,0 +26,0 @@ "peerDependencies": { |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
39154
1364
2