AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(frontend): handle JSON requests without payload (#10310)
Ubbe67eefdd35c08
diff --git a/autogpt_platform/frontend/src/app/api/proxy/[...path]/route.ts b/autogpt_platform/frontend/src/app/api/proxy/[...path]/route.tsindex 5f59a5e5c9..682915ffc2 100644--- a/autogpt_platform/frontend/src/app/api/proxy/[...path]/route.ts+++ b/autogpt_platform/frontend/src/app/api/proxy/[...path]/route.ts@@ -23,7 +23,16 @@ async function handleJsonRequest(method: string,backendUrl: string,): Promise<any> {- const payload = await req.json();+ let payload;++ try {+ payload = await req.json();+ } catch (error) {+ // Handle cases where request body is empty, invalid JSON, or already consumed+ console.warn("Failed to parse JSON from request body:", error);+ payload = null;+ }+return await makeAuthenticatedRequest(method,backendUrl,