1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Check correctly activitypub headers

This commit is contained in:
Chocobozzz 2017-11-30 12:00:40 +01:00
parent 25ed141c7c
commit 6cbdbdef17
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 43 additions and 1 deletions

View file

@ -37,7 +37,7 @@ async function checkSignature (req: Request, res: Response, next: NextFunction)
function executeIfActivityPub (fun: RequestHandler | RequestHandler[]) {
return (req: Request, res: Response, next: NextFunction) => {
if (ACTIVITY_PUB.ACCEPT_HEADERS.indexOf(req.header('Accept')) === -1) {
if (req.accepts(ACTIVITY_PUB.POTENTIAL_ACCEPT_HEADERS) === false) {
return next()
}