Skip to content

Commit

Permalink
chore: respect application/vnd.api+json content-type header (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Feb 6, 2024
1 parent 3760c68 commit daf0cae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core.ts
Expand Up @@ -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);
Expand Down

0 comments on commit daf0cae

Please sign in to comment.