auto use unsafe fetch

This commit is contained in:
Gabe Yuan
2023-08-21 23:46:42 +08:00
parent 3e9338be0e
commit d3a5d91f01
3 changed files with 19 additions and 18 deletions

View File

@@ -21,18 +21,14 @@ import { sha256 } from "../libs/utils";
* @returns
*/
export const apiSyncData = async (url, key, data) =>
fetchPolyfill(
url,
{
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${await sha256(key, KV_SALT_SYNC)}`,
},
method: "POST",
body: JSON.stringify(data),
fetchPolyfill(url, {
headers: {
"Content-type": "application/json",
Authorization: `Bearer ${await sha256(key, KV_SALT_SYNC)}`,
},
{ useUnsafe: true }
);
method: "POST",
body: JSON.stringify(data),
});
/**
* 谷歌翻译