Skip to content

Commit e98e620

Browse files
committed
fix: 🐛 content-type setup condition
1 parent d9a2db6 commit e98e620

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/adapter/adapter.utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ export const stringifyValue = (response: string | unknown): string => {
7272

7373
export const getAdapterHeaders = (request: RequestInstance) => {
7474
const isFormData = hasWindow() && request.payload instanceof FormData;
75+
const isObject = typeof request.payload === "object" && request.payload !== null;
7576
const headers: HeadersInit = {};
7677

77-
if (!isFormData) headers["Content-Type"] = "application/json";
78+
if (!isFormData && isObject) headers["Content-Type"] = "application/json";
7879

7980
Object.assign(headers, request.headers);
8081
return headers as HeadersInit;

0 commit comments

Comments
 (0)