Skip to content

Commit 4104dc3

Browse files
fix(client): don't send Content-Type for bodyless methods
1 parent 488c92c commit 4104dc3

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
@@ -231,7 +231,7 @@ export abstract class APIClient {
231231
protected defaultHeaders(opts: FinalRequestOptions): Headers {
232232
return {
233233
Accept: 'application/json',
234-
'Content-Type': 'application/json',
234+
...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }),
235235
'User-Agent': this.getUserAgent(),
236236
...getPlatformHeaders(),
237237
...this.authHeaders(opts),

0 commit comments

Comments
 (0)