From: Dan Brown Date: Wed, 30 Sep 2020 21:32:03 +0000 (+0100) Subject: Updated http service to not read 204 response data X-Git-Tag: v0.30.2~1^2 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/f3ee8f2d4cb84536c11f42ad249e629d8a01ac45 Updated http service to not read 204 response data --- diff --git a/resources/js/services/http.js b/resources/js/services/http.js index 8ecd6c109..b05dd23bf 100644 --- a/resources/js/services/http.js +++ b/resources/js/services/http.js @@ -141,10 +141,14 @@ async function request(url, options = {}) { /** * Get the content from a fetch response. * Checks the content-type header to determine the format. - * @param response + * @param {Response} response * @returns {Promise} */ async function getResponseContent(response) { + if (response.status === 204) { + return null; + } + const responseContentType = response.headers.get('Content-Type'); const subType = responseContentType.split('/').pop();