| 10 | // 全局单次注册 |
| 11 | let patchInited = false; |
| 12 | const 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 | |
| 26 | export default class WebDAVFileSystem implements FileSystem { |
| 27 | client: WebDAVClient; |