aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-01-09 16:51:51 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-01-10 10:14:04 +0100
commitf2f0eda543ab54eec0f6bcdd8ccf6e382d5cafb6 (patch)
tree2786e879b381bd637ebaaf84f7fa7f1ad08d8279 /server/controllers/static.ts
parent9270ccf6dca5b2955ad126947d4296deb385fdcb (diff)
downloadPeerTube-f2f0eda543ab54eec0f6bcdd8ccf6e382d5cafb6.tar.gz
PeerTube-f2f0eda543ab54eec0f6bcdd8ccf6e382d5cafb6.tar.zst
PeerTube-f2f0eda543ab54eec0f6bcdd8ccf6e382d5cafb6.zip
Adapt feeds content-type to accept header
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index f86a0cb5b..a4bb3a4d9 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -112,7 +112,7 @@ staticRouter.use(
112 112
113// robots.txt service 113// robots.txt service
114staticRouter.get('/robots.txt', 114staticRouter.get('/robots.txt',
115 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.ROBOTS)), 115 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ROBOTS)),
116 (_, res: express.Response) => { 116 (_, res: express.Response) => {
117 res.type('text/plain') 117 res.type('text/plain')
118 return res.send(CONFIG.INSTANCE.ROBOTS) 118 return res.send(CONFIG.INSTANCE.ROBOTS)
@@ -127,7 +127,7 @@ staticRouter.get('/security.txt',
127) 127)
128 128
129staticRouter.get('/.well-known/security.txt', 129staticRouter.get('/.well-known/security.txt',
130 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.SECURITYTXT)), 130 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.SECURITYTXT)),
131 (_, res: express.Response) => { 131 (_, res: express.Response) => {
132 res.type('text/plain') 132 res.type('text/plain')
133 return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT) 133 return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT)
@@ -136,7 +136,7 @@ staticRouter.get('/.well-known/security.txt',
136 136
137// nodeinfo service 137// nodeinfo service
138staticRouter.use('/.well-known/nodeinfo', 138staticRouter.use('/.well-known/nodeinfo',
139 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)), 139 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)),
140 (_, res: express.Response) => { 140 (_, res: express.Response) => {
141 return res.json({ 141 return res.json({
142 links: [ 142 links: [
@@ -149,13 +149,13 @@ staticRouter.use('/.well-known/nodeinfo',
149 } 149 }
150) 150)
151staticRouter.use('/nodeinfo/:version.json', 151staticRouter.use('/nodeinfo/:version.json',
152 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)), 152 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)),
153 asyncMiddleware(generateNodeinfo) 153 asyncMiddleware(generateNodeinfo)
154) 154)
155 155
156// dnt-policy.txt service (see https://www.eff.org/dnt-policy) 156// dnt-policy.txt service (see https://www.eff.org/dnt-policy)
157staticRouter.use('/.well-known/dnt-policy.txt', 157staticRouter.use('/.well-known/dnt-policy.txt',
158 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.DNT_POLICY)), 158 asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.DNT_POLICY)),
159 (_, res: express.Response) => { 159 (_, res: express.Response) => {
160 res.type('text/plain') 160 res.type('text/plain')
161 161