File tree Expand file tree Collapse file tree
packages/filesystem/webdav Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { AuthType , FileStat , WebDAVClient } from "webdav" ;
2- import { createClient } from "webdav" ;
2+ import { createClient , getPatcher } from "webdav" ;
33import type FileSystem from "../filesystem" ;
44import type { FileInfo , FileCreateOptions , FileReader , FileWriter } from "../filesystem" ;
55import { joinPath } from "../utils" ;
66import { WebDAVFileReader , WebDAVFileWriter } from "./rw" ;
77import { WarpTokenError } from "../error" ;
88
9+ // 禁止 WebDAV 请求携带浏览器 cookies,只通过账号密码认证 (#1297)
10+ getPatcher ( ) . patch ( "fetch" , ( ...args : unknown [ ] ) => {
11+ const options = ( args [ 1 ] as RequestInit ) || { } ;
12+ return fetch ( args [ 0 ] as RequestInfo | URL , { ...options , credentials : "omit" } ) ;
13+ } ) ;
14+
915export default class WebDAVFileSystem implements FileSystem {
1016 client : WebDAVClient ;
1117
You can’t perform that action at this time.
0 commit comments