sync webdav cors

This commit is contained in:
Gabe Yuan
2023-09-19 11:56:19 +08:00
parent 3494bb1297
commit 80782287d8
3 changed files with 12 additions and 3 deletions

View File

@@ -16,7 +16,15 @@ import {
} from "./storage";
import { apiSyncData } from "../apis";
import { sha256 } from "./utils";
import { createClient } from "webdav";
import { createClient, getPatcher } from "webdav";
import { fetchApi } from "./fetch";
getPatcher().patch("request", (opts) => {
return fetchApi({
input: opts.url,
init: { method: opts.method, headers: opts.headers, body: opts.data },
});
});
const syncByWebdav = async ({
key,