diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 12:00:40 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-11-30 12:00:40 +0100 |
commit | 6cbdbdef1786aabb2003918fad6cd8c0d4433f7c (patch) | |
tree | 5e7c94742773a1856f04d0c1a84b6316dd265f00 /server/middlewares/activitypub.ts | |
parent | 25ed141c7c7631ef21d8764c1163fbf8a6591391 (diff) | |
download | PeerTube-6cbdbdef1786aabb2003918fad6cd8c0d4433f7c.tar.gz PeerTube-6cbdbdef1786aabb2003918fad6cd8c0d4433f7c.tar.zst PeerTube-6cbdbdef1786aabb2003918fad6cd8c0d4433f7c.zip |
Check correctly activitypub headers
Diffstat (limited to 'server/middlewares/activitypub.ts')
-rw-r--r-- | server/middlewares/activitypub.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts index 34386e76d..7db84de97 100644 --- a/server/middlewares/activitypub.ts +++ b/server/middlewares/activitypub.ts | |||
@@ -37,7 +37,7 @@ async function checkSignature (req: Request, res: Response, next: NextFunction) | |||
37 | 37 | ||
38 | function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) { | 38 | function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) { |
39 | return (req: Request, res: Response, next: NextFunction) => { | 39 | return (req: Request, res: Response, next: NextFunction) => { |
40 | if (ACTIVITY_PUB.ACCEPT_HEADERS.indexOf(req.header('Accept')) === -1) { | 40 | if (req.accepts(ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS) === false) { |
41 | return next() | 41 | return next() |
42 | } | 42 | } |
43 | 43 | ||