Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#3870 from Dup4/fix-webdav-check
Browse files Browse the repository at this point in the history
fix: webdav check httpcode list
  • Loading branch information
Dean-YZG authored Mar 27, 2024
2 parents 43824bd + 86f42d5 commit afaa529
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/utils/cloud/webdav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit afaa529

Please sign in to comment.