aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/activitypub.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-11-29 11:34:44 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-11-29 11:34:44 +0100
commit165cdc75bf1942ed687f78094c2bd366839a7c99 (patch)
tree4b174114bf175603202c3672c5dc04c22582701d /server/middlewares/activitypub.ts
parent14063e965672ed724b7bfea6686acc14923e07a7 (diff)
downloadPeerTube-165cdc75bf1942ed687f78094c2bd366839a7c99.tar.gz
PeerTube-165cdc75bf1942ed687f78094c2bd366839a7c99.tar.zst
PeerTube-165cdc75bf1942ed687f78094c2bd366839a7c99.zip
Fix well known and json parser with mastodon
Diffstat (limited to 'server/middlewares/activitypub.ts')
-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)