From 9ba01db9e9eaa6159f058b54fb5a0654d939c9ee Mon Sep 17 00:00:00 2001 From: Yidadaa Date: Tue, 19 Sep 2023 02:12:43 +0800 Subject: [PATCH] fix: #2820 try to fix 520 error code --- app/api/cors/[...path]/route.ts | 9 +++++++-- app/components/settings.tsx | 2 +- app/locales/cn.ts | 1 + app/locales/en.ts | 1 + app/utils/cloud/webdav.ts | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/api/cors/[...path]/route.ts b/app/api/cors/[...path]/route.ts index 90404cf892a..1f70d663082 100644 --- a/app/api/cors/[...path]/route.ts +++ b/app/api/cors/[...path]/route.ts @@ -26,13 +26,18 @@ async function handle( duplex: "half", }; - console.log("[Any Proxy]", targetUrl); + const fetchResult = await fetch(targetUrl, fetchOptions); - const fetchResult = fetch(targetUrl, fetchOptions); + console.log("[Any Proxy]", targetUrl, { + status: fetchResult.status, + statusText: fetchResult.statusText, + }); return fetchResult; } export const POST = handle; +export const GET = handle; +export const OPTIONS = handle; export const runtime = "edge"; diff --git a/app/components/settings.tsx b/app/components/settings.tsx index 8e43e1d1aec..fb1d688f01c 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -275,7 +275,7 @@ function CheckButton() { return (