1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

draft "security.txt" spec integration (#1020)

This commit is contained in:
Austin Heap 2018-09-06 05:23:46 -07:00 committed by Rigel Kent
parent 35c2930776
commit 5447516b9a
5 changed files with 26 additions and 2 deletions

View file

@ -79,6 +79,21 @@ staticRouter.get('/robots.txt',
}
)
// security.txt service
staticRouter.get('/security.txt',
(_, res: express.Response) => {
return res.redirect(301, '/.well-known/security.txt')
}
)
staticRouter.get('/.well-known/security.txt',
asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.SECURITYTXT)),
(_, res: express.Response) => {
res.type('text/plain')
return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT)
}
)
// nodeinfo service
staticRouter.use('/.well-known/nodeinfo',
asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)),