From daf0cae6087580d61d4423e113259c8315c2b85a Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Tue, 6 Feb 2024 18:48:02 +0000 Subject: [PATCH] chore: respect `application/vnd.api+json` content-type header (#286) --- src/core.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index ce97181e..7b5a97bb 100644 --- a/src/core.ts +++ b/src/core.ts @@ -62,7 +62,9 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> { } const contentType = response.headers.get('content-type'); - if (contentType?.includes('application/json')) { + const isJSON = + contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); + if (isJSON) { const json = await response.json(); debug('response', response.status, response.url, response.headers, json);