From 86f42d56f28b725006e60dbf2ae875917feb3a3f Mon Sep 17 00:00:00 2001 From: Dup4 Date: Thu, 18 Jan 2024 09:11:13 +0800 Subject: [PATCH] fix: webdav check httpcode list Signed-off-by: Dup4 --- app/utils/cloud/webdav.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/utils/cloud/webdav.ts b/app/utils/cloud/webdav.ts index 3a1553c1035..51159ca1aef 100644 --- a/app/utils/cloud/webdav.ts +++ b/app/utils/cloud/webdav.ts @@ -20,8 +20,15 @@ export function createWebDavClient(store: SyncStore) { headers: this.headers(), proxyUrl, }); - console.log("[WebDav] check", res.status, res.statusText); - return [201, 200, 404, 301, 302, 307, 308].includes(res.status); + const success = [201, 200, 404, 405, 301, 302, 307, 308].includes( + res.status, + ); + console.log( + `[WebDav] check ${success ? "success" : "failed"}, ${res.status} ${ + res.statusText + }`, + ); + return success; } catch (e) { console.error("[WebDav] failed to check", e); }