From 29e03b88c75355341859bf0b3e3c6c34699a34a9 Mon Sep 17 00:00:00 2001 From: kidv Date: Sun, 24 Mar 2024 04:07:25 +0800 Subject: [PATCH 1/2] Fix: Handle empty server response in API call --- app/client/platforms/openai.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/client/platforms/openai.ts b/app/client/platforms/openai.ts index 629158843c41..78e628ad771c 100644 --- a/app/client/platforms/openai.ts +++ b/app/client/platforms/openai.ts @@ -151,6 +151,9 @@ export class ChatGPTApi implements LLMApi { if (finished || controller.signal.aborted) { responseText += remainText; console.log("[Response Animation] finished"); + if (responseText?.length === 0) { + options.onError?.(new Error("empty response from server")); + } return; } From e8d76a513dbe5debbe747677154c0f6141380421 Mon Sep 17 00:00:00 2001 From: fred-bf <157469842+fred-bf@users.noreply.github.com> Date: Sun, 24 Mar 2024 14:15:04 +0800 Subject: [PATCH 2/2] patch: disable webdav redirect --- app/api/webdav/[...path]/route.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/webdav/[...path]/route.ts b/app/api/webdav/[...path]/route.ts index 81ede0fd870a..56c2388aed01 100644 --- a/app/api/webdav/[...path]/route.ts +++ b/app/api/webdav/[...path]/route.ts @@ -101,6 +101,7 @@ async function handle( authorization: req.headers.get("authorization") ?? "", }, body: shouldNotHaveBody ? null : req.body, + redirect: 'manual', method, // @ts-ignore duplex: "half",