summaryrefslogtreecommitdiff
path: root/packages/client/src/os.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-12-03 19:42:05 +0900
committerGitHub <noreply@github.com>2022-12-03 19:42:05 +0900
commit3a7182bfb5734599321fc03ea77c48b4dbc326d5 (patch)
treec96c46e0a9662809c40381d833e1ed1ca28de873 /packages/client/src/os.ts
parentUpdate CHANGELOG.md (diff)
downloadmisskey-3a7182bfb5734599321fc03ea77c48b4dbc326d5.tar.gz
misskey-3a7182bfb5734599321fc03ea77c48b4dbc326d5.tar.bz2
misskey-3a7182bfb5734599321fc03ea77c48b4dbc326d5.zip
Fastify (#9106)
* wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * fix * Update SignupApiService.ts * wip * wip * Update ClientServerService.ts * wip * wip * wip * Update WellKnownServerService.ts * wip * wip * update des * wip * Update ApiServerService.ts * wip * update deps * Update WellKnownServerService.ts * wip * update deps * Update ApiCallService.ts * Update ApiCallService.ts * Update ApiServerService.ts
Diffstat (limited to 'packages/client/src/os.ts')
-rw-r--r--packages/client/src/os.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts
index 515fc47819..7e57dcb4af 100644
--- a/packages/client/src/os.ts
+++ b/packages/client/src/os.ts
@@ -29,11 +29,14 @@ export const api = ((endpoint: string, data: Record<string, any> = {}, token?: s
if (token !== undefined) (data as any).i = token;
// Send request
- fetch(endpoint.indexOf('://') > -1 ? endpoint : `${apiUrl}/${endpoint}`, {
+ window.fetch(endpoint.indexOf('://') > -1 ? endpoint : `${apiUrl}/${endpoint}`, {
method: 'POST',
body: JSON.stringify(data),
credentials: 'omit',
cache: 'no-cache',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
}).then(async (res) => {
const body = res.status === 204 ? null : await res.json();
@@ -63,7 +66,7 @@ export const apiGet = ((endpoint: string, data: Record<string, any> = {}) => {
const promise = new Promise((resolve, reject) => {
// Send request
- fetch(`${apiUrl}/${endpoint}?${query}`, {
+ window.fetch(`${apiUrl}/${endpoint}?${query}`, {
method: 'GET',
credentials: 'omit',
cache: 'default',