Skip to content

Commit

Permalink
Merge pull request #139 from mapado/jbd-fix-content-type-method-get
Browse files Browse the repository at this point in the history
The Content-Type entity-header field indicates the media type of the …
  • Loading branch information
bjulien authored Jan 23, 2024
2 parents 93d37ae + 821955f commit 4ea04c2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/client/AbstractClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,13 @@ class AbstractClient<D extends MetadataDefinition> {
requestParams: RequestInit
): Promise<Response> {
let params = requestParams;
let baseHeaders: HeadersInit = {};

const baseHeaders: HeadersInit = {
'Content-Type': 'application/json',
};
if (params.method !== 'GET' || (params.method !== 'GET' && params.method !== 'DELETE')) {
baseHeaders = {
'Content-Type': 'application/json',
};
}

if (accessToken) {
baseHeaders.Authorization = `${this.sdk.config.authorizationType} ${accessToken}`;
Expand Down

0 comments on commit 4ea04c2

Please sign in to comment.