MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / check

Function check

app/utils/cloud/webdav.ts:15–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13
14 return {
15 async check() {
16 try {
17 const res = await fetch(this.path(folder, proxyUrl, "MKCOL"), {
18 method: "GET",
19 headers: this.headers(),
20 });
21 const success = [201, 200, 404, 405, 301, 302, 307, 308].includes(
22 res.status,
23 );
24 console.log(
25 `[WebDav] check ${success ? "success" : "failed"}, ${res.status} ${
26 res.statusText
27 }`,
28 );
29 return success;
30 } catch (e) {
31 console.error("[WebDav] failed to check", e);
32 }
33
34 return false;
35 },
36
37 async get(key: string) {
38 const res = await fetch(this.path(fileName, proxyUrl), {

Callers

nothing calls this directly

Calls 3

errorMethod · 0.80
fetchFunction · 0.50
pathMethod · 0.45

Tested by

no test coverage detected