mirror of
https://github.com/Yidadaa/ChatGPT-Next-Web.git
synced 2025-08-08 16:51:54 +08:00
fix: add webdav request filter
This commit is contained in:
@@ -60,16 +60,18 @@ export function createWebDavClient(store: SyncStore) {
|
||||
};
|
||||
},
|
||||
path(path: string) {
|
||||
let url = config.endpoint;
|
||||
|
||||
if (!url.endsWith("/")) {
|
||||
url += "/";
|
||||
if (!path.endsWith("/")) {
|
||||
path += "/";
|
||||
}
|
||||
|
||||
if (path.startsWith("/")) {
|
||||
path = path.slice(1);
|
||||
}
|
||||
|
||||
let url = new URL("/api/webdav/" + path);
|
||||
|
||||
// add query params
|
||||
url.searchParams.append("endpoint", config.endpoint);
|
||||
|
||||
return url + path;
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user