diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-12-03 19:42:05 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-03 19:42:05 +0900 |
| commit | 3a7182bfb5734599321fc03ea77c48b4dbc326d5 (patch) | |
| tree | c96c46e0a9662809c40381d833e1ed1ca28de873 /packages/client/src/os.ts | |
| parent | Update CHANGELOG.md (diff) | |
| download | misskey-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.ts | 7 |
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', |