Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

Fix missing Content-Type in backendCall for POST without body

dorengstearns8c14b1b1dff8
diff --git a/src/api/backend.ts b/src/api/backend.ts
index 6528b019..19e10791 100644
--- a/src/api/backend.ts
+++ b/src/api/backend.ts
@@ -175,9 +175,9 @@ export async function backendCall<T = any>(
if (options.headers) {
Object.assign(headers, options.headers);
}
- } else if (args && method !== "GET") {
+ } else if (method !== "GET") {
headers["Content-Type"] = "application/json";
- fetchOptions.body = JSON.stringify(args);
+ fetchOptions.body = JSON.stringify(args || {});
}
fetchOptions.headers = headers;