Skip to content

Commit 244304d

Browse files
author
Fransis Young
committed
chore(client-fetch,client-nuxt): removes redundant delete header condition
1 parent 27c0521 commit 244304d

File tree

2 files changed

+2
-8
lines changed
  • packages/openapi-ts/src/plugins/@hey-api

2 files changed

+2
-8
lines changed

packages/openapi-ts/src/plugins/@hey-api/client-fetch/bundle/client.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ export const createClient = (config: Config = {}): Client => {
6363
}
6464

6565
// remove Content-Type header if body is empty to avoid sending invalid requests
66-
if (
67-
opts.body === undefined ||
68-
(opts.serializedBody !== undefined && opts.serializedBody === '')
69-
) {
66+
if (opts.body === undefined || opts.serializedBody === '') {
7067
opts.headers.delete('Content-Type');
7168
}
7269

packages/openapi-ts/src/plugins/@hey-api/client-next/bundle/client.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ export const createClient = (config: Config = {}): Client => {
6262
}
6363

6464
// remove Content-Type header if body is empty to avoid sending invalid requests
65-
if (
66-
opts.body === undefined ||
67-
(opts.serializedBody !== undefined && opts.serializedBody === '')
68-
) {
65+
if (opts.body === undefined || opts.serializedBody === '') {
6966
opts.headers.delete('Content-Type');
7067
}
7168

0 commit comments

Comments
 (0)