aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/activitypub.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts
index 061b2dddc..34386e76d 100644
--- a/server/middlewares/activitypub.ts
+++ b/server/middlewares/activitypub.ts
@@ -37,10 +37,12 @@ async function checkSignature (req: Request, res: Response, next: NextFunction)
37 37
38function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) { 38function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) {
39 return (req: Request, res: Response, next: NextFunction) => { 39 return (req: Request, res: Response, next: NextFunction) => {
40 if (req.header('Accept') !== ACTIVITY_PUB.ACCEPT_HEADER) { 40 if (ACTIVITY_PUB.ACCEPT_HEADERS.indexOf(req.header('Accept')) === -1) {
41 return next() 41 return next()
42 } 42 }
43 43
44 logger.debug('ActivityPub request for %s.', req.url)
45
44 if (Array.isArray(fun) === true) { 46 if (Array.isArray(fun) === true) {
45 return eachSeries(fun as RequestHandler[], (f, cb) => { 47 return eachSeries(fun as RequestHandler[], (f, cb) => {
46 f(req, res, cb) 48 f(req, res, cb)