Skip to content

Commit d96149f

Browse files
fix(client): don't send Content-Type for bodyless methods
1 parent 44c94cb commit d96149f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export abstract class APIClient {
217217
protected defaultHeaders(opts: FinalRequestOptions): Headers {
218218
return {
219219
Accept: 'application/json',
220-
'Content-Type': 'application/json',
220+
...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }),
221221
'User-Agent': this.getUserAgent(),
222222
...getPlatformHeaders(),
223223
...this.authHeaders(opts),

0 commit comments

Comments
 (0)