MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / initWebDAVPatch

Function initWebDAVPatch

packages/filesystem/webdav/webdav.ts:12–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10// 全局单次注册
11let patchInited = false;
12const initWebDAVPatch = () => {
13 if (patchInited) return;
14 patchInited = true;
15 return getPatcher().patch("fetch", (...args: unknown[]) => {
16 const options = (args[1] as RequestInit) || {};
17 const headers = new Headers((options.headers as HeadersInit) || {});
18 return fetch(args[0] as RequestInfo | URL, {
19 ...options,
20 headers,
21 credentials: "omit",
22 });
23 });
24};
25
26export default class WebDAVFileSystem implements FileSystem {
27 client: WebDAVClient;

Callers 1

fromCredentialsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected