Skip to content

Commit

Permalink
fix: webdav check httpcode list
Browse files Browse the repository at this point in the history
Signed-off-by: Dup4 <[email protected]>
  • Loading branch information
Dup4 committed Jan 18, 2024
1 parent 0cf6614 commit 86f42d5
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 @@ -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);
}
Expand Down

0 comments on commit 86f42d5

Please sign in to comment.