From 0c880def5e99ae339a8cc03e1d753fce70231b66 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 18 Apr 2021 22:12:26 +0100 Subject: [PATCH] Fixed response JSON detection when charset existed Fixes #2684 --- resources/js/services/http.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/services/http.js b/resources/js/services/http.js index b05dd23bf..00865e69b 100644 --- a/resources/js/services/http.js +++ b/resources/js/services/http.js @@ -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();