diff --git a/source/core/Ky.ts b/source/core/Ky.ts index f4ac5914..c6dcd9b5 100644 --- a/source/core/Ky.ts +++ b/source/core/Ky.ts @@ -101,10 +101,7 @@ export class Ky { return options.parseJson(await response.text()); } - // If error causes when call JSON.parse - try { - return (await response.json()); - } catch { + if (response.headers.get('accept')?.startsWith('text')) { return response.text(); } }