diff --git a/src/api-request.ts b/src/api-request.ts index c86ede9..68e1d00 100644 --- a/src/api-request.ts +++ b/src/api-request.ts @@ -91,9 +91,9 @@ export class LastFMApiRequest { httpRequest.end(); }).then(([response, content]) => { - if (response.headers['content-type'] !== 'application/json') { + if (!response.headers['content-type']?.includes('application/json')) { throw new LastFMResponseError( - `lastfm-ts-api: Expected JSON response but received '${response.headers['content-type']}'`, + `lastfm-ts-api: Expected JSON response ('application/json') but received '${response.headers['content-type']}'`, { response, content } ); }