diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-17 22:17:55 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-17 22:17:55 +0900 |
| commit | ff5ab7d12f34ab9eef592be6abc88459e6199453 (patch) | |
| tree | 74809d3d800ba623fb25704af829c790c50392b9 /src | |
| parent | :art: (diff) | |
| download | sharkey-ff5ab7d12f34ab9eef592be6abc88459e6199453.tar.gz sharkey-ff5ab7d12f34ab9eef592be6abc88459e6199453.tar.bz2 sharkey-ff5ab7d12f34ab9eef592be6abc88459e6199453.zip | |
Fix bug
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/activitypub.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index e27e2552f3..73ed43406d 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -1,3 +1,4 @@ +import * as mongo from 'mongodb'; import * as Router from 'koa-router'; const json = require('koa-json-body'); const httpSignature = require('http-signature'); @@ -49,7 +50,7 @@ router.get('/notes/:note', async (ctx, next) => { } const note = await Note.findOne({ - _id: ctx.params.note + _id: new mongo.ObjectID(ctx.params.note) }); if (note === null) { @@ -62,7 +63,7 @@ router.get('/notes/:note', async (ctx, next) => { // outbot router.get('/users/:user/outbox', async ctx => { - const userId = ctx.params.user; + const userId = new mongo.ObjectID(ctx.params.user); const user = await User.findOne({ _id: userId }); @@ -84,7 +85,7 @@ router.get('/users/:user/outbox', async ctx => { // publickey router.get('/users/:user/publickey', async ctx => { - const userId = ctx.params.user; + const userId = new mongo.ObjectID(ctx.params.user); const user = await User.findOne({ _id: userId }); @@ -102,7 +103,7 @@ router.get('/users/:user/publickey', async ctx => { // user router.get('/users/:user', async ctx => { - const userId = ctx.params.user; + const userId = new mongo.ObjectID(ctx.params.user); const user = await User.findOne({ _id: userId }); |