diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-14 03:23:06 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-14 03:23:06 +0900 |
| commit | 04285c9498859edca86f2f70f7bddda204ecee9d (patch) | |
| tree | a672912bf462096bb4604a4ee3a46092f0e2829b | |
| parent | Use require to avoid warning (diff) | |
| download | sharkey-04285c9498859edca86f2f70f7bddda204ecee9d.tar.gz sharkey-04285c9498859edca86f2f70f7bddda204ecee9d.tar.bz2 sharkey-04285c9498859edca86f2f70f7bddda204ecee9d.zip | |
Fix bug
| -rw-r--r-- | package.json | 1 | ||||
| -rw-r--r-- | src/server/activitypub.ts | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/package.json b/package.json index d82e5d2330..ea2b0f2514 100644 --- a/package.json +++ b/package.json @@ -137,6 +137,7 @@ "js-yaml": "3.11.0", "jsdom": "11.7.0", "koa": "2.5.0", + "koa-body": "^2.5.0", "koa-bodyparser": "4.2.0", "koa-compress": "^2.0.0", "koa-favicon": "2.0.1", diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index 804f0f870d..954cc7480e 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -1,4 +1,5 @@ import * as Router from 'koa-router'; +const koaBody = require('koa-body'); const parseRequest = require('http-signature'); import { createHttp } from '../queue'; @@ -18,7 +19,7 @@ const router = new Router(); //#region Routing // inbox -router.post('/users/:user/inbox', ctx => { +router.post('/users/:user/inbox', koaBody(), ctx => { let signature; ctx.req.headers.authorization = 'Signature ' + ctx.req.headers.signature; |