From f8bfec29633e1f99bdf336cfcfa894c49a8cd355 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 5 Apr 2018 17:52:46 +0900 Subject: [PATCH] wip --- src/server/activitypub/inbox.ts | 4 +--- src/server/activitypub/outbox.ts | 3 +-- src/server/activitypub/post.ts | 3 +-- src/server/activitypub/publickey.ts | 3 +-- src/server/activitypub/user.ts | 3 +-- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/server/activitypub/inbox.ts b/src/server/activitypub/inbox.ts index b0015409a..1b6cc0c00 100644 --- a/src/server/activitypub/inbox.ts +++ b/src/server/activitypub/inbox.ts @@ -3,9 +3,7 @@ import * as express from 'express'; import { parseRequest } from 'http-signature'; import { createHttp } from '../../queue'; -const app = express(); - -app.disable('x-powered-by'); +const app = express.Router(); app.post('/@:user/inbox', bodyParser.json({ type() { diff --git a/src/server/activitypub/outbox.ts b/src/server/activitypub/outbox.ts index 9ecb0c071..976908d1f 100644 --- a/src/server/activitypub/outbox.ts +++ b/src/server/activitypub/outbox.ts @@ -6,8 +6,7 @@ import config from '../../config'; import Post from '../../models/post'; import withUser from './with-user'; -const app = express(); -app.disable('x-powered-by'); +const app = express.Router(); app.get('/@:user/outbox', withUser(username => { return `${config.url}/@${username}/inbox`; diff --git a/src/server/activitypub/post.ts b/src/server/activitypub/post.ts index 91d91aeb9..355c60356 100644 --- a/src/server/activitypub/post.ts +++ b/src/server/activitypub/post.ts @@ -5,8 +5,7 @@ import parseAcct from '../../acct/parse'; import Post from '../../models/post'; import User from '../../models/user'; -const app = express(); -app.disable('x-powered-by'); +const app = express.Router(); app.get('/@:user/:post', async (req, res, next) => { const accepted = req.accepts(['html', 'application/activity+json', 'application/ld+json']); diff --git a/src/server/activitypub/publickey.ts b/src/server/activitypub/publickey.ts index c564c437e..b48504927 100644 --- a/src/server/activitypub/publickey.ts +++ b/src/server/activitypub/publickey.ts @@ -4,8 +4,7 @@ import render from '../../remote/activitypub/renderer/key'; import config from '../../config'; import withUser from './with-user'; -const app = express(); -app.disable('x-powered-by'); +const app = express.Router(); app.get('/@:user/publickey', withUser(username => { return `${config.url}/@${username}/publickey`; diff --git a/src/server/activitypub/user.ts b/src/server/activitypub/user.ts index baf2dc9a0..f05497451 100644 --- a/src/server/activitypub/user.ts +++ b/src/server/activitypub/user.ts @@ -11,8 +11,7 @@ const respond = withUser(username => `${config.url}/@${username}`, (user, req, r res.json(rendered); }); -const app = express(); -app.disable('x-powered-by'); +const app = express.Router(); app.get('/@:user', (req, res, next) => { const accepted = req.accepts(['html', 'application/activity+json', 'application/ld+json']);