Fixed response JSON detection when charset existed

Fixes #2684
This commit is contained in:
Dan Brown 2021-04-18 22:12:26 +01:00
parent e4660a5ba2
commit 0c880def5e

View File

@ -149,8 +149,8 @@ async function getResponseContent(response) {
return null;
}
const responseContentType = response.headers.get('Content-Type');
const subType = responseContentType.split('/').pop();
const responseContentType = response.headers.get('Content-Type') || '';
const subType = responseContentType.split(';')[0].split('/').pop();
if (subType === 'javascript' || subType === 'json') {
return await response.json();