diff --git a/src/static/js/helper.js b/src/static/js/helper.js index 02e9aa493162cdfdc16dbc29327761759b663fa1..8c210f416c6eb500218cfb4fa808a510b0dfb5b9 100644 --- a/src/static/js/helper.js +++ b/src/static/js/helper.js @@ -1,6 +1,10 @@ async function fetchAPI(endpoint, options) { const res = await fetch(endpoint, options); - const data = await res.json(); + const contentType = res.headers.get('content-length'); + let data + if (!contentType.includes("0")) { + data = await res.json(); + } if (res.ok) { return data; }