MCPcopy Create free account
hub / github.com/bewcloud/bewcloud / callDav

Function callDav

pages/dav_test.ts:33–44  ·  view source on GitHub ↗
(
  method: string,
  filePath: string | undefined,
  user: User,
  init: RequestInit = {},
)

Source from the content-addressed store, hash-verified

31}
32
33async function callDav(
34 method: string,
35 filePath: string | undefined,
36 user: User,
37 init: RequestInit = {},
38): Promise<Response> {
39 const url = `http://localhost:8000/dav/${filePath ?? ''}`;
40 const request = new Request(url, { method, ...init });
41 const match = { pathname: { groups: { filePath } } } as unknown as URLPatternResult;
42
43 return await davPage.catchAll!({ request, match, user, isRunningLocally: true });
44}
45
46const lockRequestBody =
47 `<?xml version="1.0" encoding="utf-8"?><D:lockinfo xmlns:D="DAV:"><D:lockscope><D:exclusive/></D:lockscope><D:locktype><D:write/></D:locktype><D:owner><D:href>test-owner</D:href></D:owner></D:lockinfo>`;

Callers 2

lockPathFunction · 0.85
dav_test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected