Skip to content

Commit d1c431b

Browse files
authored
Check that body isJsonifiable before stringify
1 parent c6164cb commit d1c431b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/toolkit/src/query/fetchBaseQuery.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export function fetchBaseQuery({
218218
config.headers.set('content-type', 'application/json')
219219
}
220220

221-
if (body && isJsonContentType(config.headers)) {
221+
if (isJsonifiable(body) && isJsonContentType(config.headers)) {
222222
config.body = JSON.stringify(body)
223223
}
224224

0 commit comments

Comments
 (0)