summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author果物リン <fruitriin@riinswork.space>2023-01-17 06:47:46 +0900
committerGitHub <noreply@github.com>2023-01-17 06:47:46 +0900
commit4f62f6f288d624e8089b957c88d45b3f68283b0c (patch)
tree6c6451053a02d6efaca964f87939e1c1e95e09db /src
parentenhance: add missing InstanceMetadata fields (#50) (diff)
downloadmisskey-4f62f6f288d624e8089b957c88d45b3f68283b0c.tar.gz
misskey-4f62f6f288d624e8089b957c88d45b3f68283b0c.tar.bz2
misskey-4f62f6f288d624e8089b957c88d45b3f68283b0c.zip
application/json の content-type header をデフォルトで付与する (#52)
Diffstat (limited to 'src')
-rw-r--r--src/api.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/api.ts b/src/api.ts
index 2cf8488106..1704b6e462 100644
--- a/src/api.ts
+++ b/src/api.ts
@@ -19,6 +19,7 @@ export type FetchLike = (input: string, init?: {
body?: string;
credentials?: RequestCredentials;
cache?: RequestCache;
+ headers: {[key in string]: string}
}) => Promise<{
status: number;
json(): Promise<any>;
@@ -75,6 +76,9 @@ export class APIClient {
...params,
i: credential !== undefined ? credential : this.credential,
}),
+ headers: {
+ 'Content-Type': 'application/json',
+ },
credentials: 'omit',
cache: 'no-cache',
}).then(async (res) => {