Merge pull request #3870 from Dup4/fix-webdav-check

fix: webdav check httpcode list
This commit is contained in:
DeanYao 2024-03-27 14:04:15 +08:00 committed by GitHub
commit afaa529ba6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 2 deletions

View File

@ -18,8 +18,15 @@ export function createWebDavClient(store: SyncStore) {
method: "MKCOL",
headers: this.headers(),
});
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);
}