]> BookStack Code Mirror - bookstack/blobdiff - resources/js/services/http.js
Addressed additional unsupported array spread operation
[bookstack] / resources / js / services / http.js
index b05dd23bfd7222834eade6395f655d5916b1b2c1..00865e69bd8ff83698864ed7c6d0dd0042ef465f 100644 (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();