fix: add webdav request filter

This commit is contained in:
Fred
2024-03-14 00:33:26 +08:00
parent 9a8497299d
commit 038fa3b301
3 changed files with 111 additions and 6 deletions

View File

@@ -94,7 +94,7 @@ export function createUpstashClient(store: SyncStore) {
path = path.slice(1);
}
let url = new URL("/api/" + path);
let url = new URL("/api/upstash/" + path);
// add query params
url.searchParams.append("endpoint", config.endpoint);

View File

@@ -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;
},
};