Skip to content

Commit fef85a6

Browse files
committed
Merge branch 'worktree-fix-webdav-cookies-1297' into dev
2 parents e56ddd8 + 57c66f4 commit fef85a6

4 files changed

Lines changed: 41 additions & 20 deletions

File tree

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
"crypto-js": "^4.2.0",
4040
"dayjs": "^1.11.13",
4141
"dexie": "^4.0.10",
42-
"dompurify": "^3.3.1",
42+
"dompurify": "^3.3.3",
4343
"eslint-linter-browserify": "9.26.0",
4444
"eventemitter3": "^5.0.1",
45-
"fast-xml-parser": "^5.3.6",
45+
"fast-xml-parser": "^5.5.8",
4646
"i18next": "^23.16.4",
4747
"monaco-editor": "^0.52.2",
4848
"react": "^18.3.1",

packages/filesystem/webdav/webdav.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import type { AuthType, FileStat, WebDAVClient } from "webdav";
2-
import { createClient } from "webdav";
2+
import { createClient, getPatcher } from "webdav";
33
import type FileSystem from "../filesystem";
44
import type { FileInfo, FileCreateOptions, FileReader, FileWriter } from "../filesystem";
55
import { joinPath } from "../utils";
66
import { WebDAVFileReader, WebDAVFileWriter } from "./rw";
77
import { 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+
915
export default class WebDAVFileSystem implements FileSystem {
1016
client: WebDAVClient;
1117

pnpm-lock.yaml

Lines changed: 30 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/pages/components/CodeEditor/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const CodeEditor: React.ForwardRefRenderFunction<{ editor: editor.IStandaloneCod
8585
suggestSelection: "first",
8686

8787
// Enable word based suggestions
88-
wordBasedSuggestions: "matchingDocuments",
88+
wordBasedSuggestions: "off",
8989

9090
// Enable parameter hints
9191
parameterHints: {
@@ -97,7 +97,7 @@ const CodeEditor: React.ForwardRefRenderFunction<{ editor: editor.IStandaloneCod
9797
// https://github.com/is0383kk/VSCode
9898

9999
quickSuggestions: {
100-
other: "inline",
100+
other: true,
101101
comments: true,
102102
strings: true,
103103
},

0 commit comments

Comments
 (0)