Skip to content

Commit 021bf24

Browse files
committed
feat: conditionally set Content-Type header for non-multipart requests in CoreAPI
1 parent bd6afa6 commit 021bf24

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/Common/API/CoreAPI.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,13 @@ class CoreAPI {
5555
method: type,
5656
signal,
5757
body: data ? JSON.stringify(data) : undefined,
58-
headers: {
59-
'Content-Type': 'application/json',
60-
},
58+
...(data && !isMultipartRequest
59+
? {
60+
headers: {
61+
'Content-Type': 'application/json',
62+
},
63+
}
64+
: {}),
6165
}
6266
// eslint-disable-next-line dot-notation
6367
options['credentials'] = 'include' as RequestCredentials

0 commit comments

Comments
 (0)