Skip to content

Commit 6acb46b

Browse files
StynStijnLammens
authored andcommitted
Don't set multipart/form-data content-type (#173)
* dont set multipart/form-data content-type * add ContentType.FormData exception to default template Co-authored-by: stijn.lammens <[email protected]>
1 parent 166ad8d commit 6acb46b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/default/http-client.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class HttpClient<SecurityDataType = unknown> {
171171
{
172172
...requestParams,
173173
headers: {
174-
...(type ? { "Content-Type": type } : {}),
174+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
175175
...(requestParams.headers || {}),
176176
},
177177
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

templates/modular/http-client.eta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export class HttpClient<SecurityDataType = unknown> {
171171
{
172172
...requestParams,
173173
headers: {
174-
...(type ? { "Content-Type": type } : {}),
174+
...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}),
175175
...(requestParams.headers || {}),
176176
},
177177
signal: cancelToken ? this.createAbortSignal(cancelToken) : void 0,

0 commit comments

Comments
 (0)