From 42a14508f6ee3a9aef374e8a8695230b3839dcb2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 27 Sep 2019 05:50:34 +0900 Subject: Update dependencies :rocket: --- src/server/activitypub.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/server/activitypub.ts') diff --git a/src/server/activitypub.ts b/src/server/activitypub.ts index 1803fef79c..2dbacf5194 100644 --- a/src/server/activitypub.ts +++ b/src/server/activitypub.ts @@ -1,4 +1,4 @@ -import * as Router from 'koa-router'; +import * as Router from '@koa/router'; import * as json from 'koa-json-body'; import * as httpSignature from 'http-signature'; @@ -23,7 +23,7 @@ const router = new Router(); //#region Routing -function inbox(ctx: Router.IRouterContext) { +function inbox(ctx: Router.RouterContext) { let signature; ctx.req.headers.authorization = `Signature ${ctx.req.headers.signature}`; @@ -40,13 +40,13 @@ function inbox(ctx: Router.IRouterContext) { ctx.status = 202; } -function isActivityPubReq(ctx: Router.IRouterContext) { +function isActivityPubReq(ctx: Router.RouterContext) { ctx.response.vary('Accept'); const accepted = ctx.accepts('html', 'application/activity+json', 'application/ld+json'); return ['application/activity+json', 'application/ld+json'].includes(accepted as string); } -export function setResponseType(ctx: Router.IRouterContext) { +export function setResponseType(ctx: Router.RouterContext) { const accpet = ctx.accepts('application/activity+json', 'application/ld+json'); if (accpet === 'application/ld+json') { ctx.response.type = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"; charset=utf-8'; @@ -146,7 +146,7 @@ router.get('/users/:user/publickey', async ctx => { }); // user -async function userInfo(ctx: Router.IRouterContext, user: User | undefined) { +async function userInfo(ctx: Router.RouterContext, user: User | undefined) { if (user == null) { ctx.status = 404; return; -- cgit v1.2.3-freya