diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-01-09 16:51:51 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-01-10 10:14:04 +0100 |
commit | f2f0eda543ab54eec0f6bcdd8ccf6e382d5cafb6 (patch) | |
tree | 2786e879b381bd637ebaaf84f7fa7f1ad08d8279 /server/controllers/static.ts | |
parent | 9270ccf6dca5b2955ad126947d4296deb385fdcb (diff) | |
download | PeerTube-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.ts | 10 |
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 |
114 | staticRouter.get('/robots.txt', | 114 | staticRouter.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 | ||
129 | staticRouter.get('/.well-known/security.txt', | 129 | staticRouter.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 |
138 | staticRouter.use('/.well-known/nodeinfo', | 138 | staticRouter.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 | ) |
151 | staticRouter.use('/nodeinfo/:version.json', | 151 | staticRouter.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) |
157 | staticRouter.use('/.well-known/dnt-policy.txt', | 157 | staticRouter.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 | ||