summaryrefslogtreecommitdiff
path: root/src/server/api/api-handler.ts
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2019-09-27 05:50:34 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-09-27 05:50:34 +0900
commit42a14508f6ee3a9aef374e8a8695230b3839dcb2 (patch)
treebb177c017fe1d95796593ea9fca2e639e1035a9b /src/server/api/api-handler.ts
parentUpdate node version (diff)
downloadsharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.gz
sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.bz2
sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.zip
Update dependencies :rocket:
Diffstat (limited to 'src/server/api/api-handler.ts')
-rw-r--r--src/server/api/api-handler.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/server/api/api-handler.ts b/src/server/api/api-handler.ts
index 2de6994f32..a3be1f2aae 100644
--- a/src/server/api/api-handler.ts
+++ b/src/server/api/api-handler.ts
@@ -6,7 +6,7 @@ import call from './call';
import { ApiError } from './error';
export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res) => {
- const body = ctx.is('multipart/form-data') ? (ctx.req as any).body : ctx.request.body;
+ const body = ctx.request.body;
const reply = (x?: any, y?: ApiError) => {
if (x == null) {
@@ -31,7 +31,7 @@ export default (endpoint: IEndpoint, ctx: Koa.BaseContext) => new Promise((res)
// Authentication
authenticate(body['i']).then(([user, app]) => {
// API invoking
- call(endpoint.name, user, app, body, (ctx.req as any).file).then((res: any) => {
+ call(endpoint.name, user, app, body, (ctx as any).file).then((res: any) => {
reply(res);
}).catch((e: ApiError) => {
reply(e.httpStatusCode ? e.httpStatusCode : e.kind == 'client' ? 400 : 500, e);