summaryrefslogtreecommitdiff
path: root/src/server/activitypub.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/activitypub.ts
parentUpdate node version (diff)
downloadsharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.gz
sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.tar.bz2
sharkey-42a14508f6ee3a9aef374e8a8695230b3839dcb2.zip
Update dependencies :rocket:
Diffstat (limited to 'src/server/activitypub.ts')
-rw-r--r--src/server/activitypub.ts10
1 files changed, 5 insertions, 5 deletions
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;