diff --git a/src/infrastructure/KyRequester.ts b/src/infrastructure/KyRequester.ts index 27e472d7b..cadcfdbde 100644 --- a/src/infrastructure/KyRequester.ts +++ b/src/infrastructure/KyRequester.ts @@ -35,12 +35,12 @@ function defaultRequest(service: any, { body, query, sudo, method }) { } async function processBody(response) { - const contentType = response.headers.get('content-type'); + const contentType = response.headers.get('content-type') || ''; const content = await response.text(); if(contentType.includes('json')) { try { - return JSON.parse(content || {}); + return JSON.parse(content || "{}"); } catch { return {}; }