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

Adapt feeds content-type to accept header

This commit is contained in:
Rigel Kent 2020-01-09 16:51:51 +01:00 committed by Chocobozzz
parent 9270ccf6dc
commit f2f0eda543
8 changed files with 67 additions and 24 deletions

View file

@ -112,7 +112,7 @@ staticRouter.use(
// robots.txt service
staticRouter.get('/robots.txt',
asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.ROBOTS)),
asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ROBOTS)),
(_, res: express.Response) => {
res.type('text/plain')
return res.send(CONFIG.INSTANCE.ROBOTS)
@ -127,7 +127,7 @@ staticRouter.get('/security.txt',
)
staticRouter.get('/.well-known/security.txt',
asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.SECURITYTXT)),
asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.SECURITYTXT)),
(_, res: express.Response) => {
res.type('text/plain')
return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT)
@ -136,7 +136,7 @@ staticRouter.get('/.well-known/security.txt',
// nodeinfo service
staticRouter.use('/.well-known/nodeinfo',
asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)),
asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)),
(_, res: express.Response) => {
return res.json({
links: [
@ -149,13 +149,13 @@ staticRouter.use('/.well-known/nodeinfo',
}
)
staticRouter.use('/nodeinfo/:version.json',
asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)),
asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)),
asyncMiddleware(generateNodeinfo)
)
// dnt-policy.txt service (see https://www.eff.org/dnt-policy)
staticRouter.use('/.well-known/dnt-policy.txt',
asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.DNT_POLICY)),
asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.DNT_POLICY)),
(_, res: express.Response) => {
res.type('text/plain')