diff options
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r-- | server/controllers/static.ts | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 35e024dda..912d7e36c 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts | |||
@@ -3,7 +3,7 @@ import * as express from 'express' | |||
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import { serveIndexHTML } from '@server/lib/client-html' | 4 | import { serveIndexHTML } from '@server/lib/client-html' |
5 | import { ServerConfigManager } from '@server/lib/server-config-manager' | 5 | import { ServerConfigManager } from '@server/lib/server-config-manager' |
6 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | 6 | import { HttpStatusCode } from '@shared/models' |
7 | import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo/nodeinfo.model' | 7 | import { HttpNodeinfoDiasporaSoftwareNsSchema20 } from '../../shared/models/nodeinfo/nodeinfo.model' |
8 | import { root } from '../helpers/core-utils' | 8 | import { root } from '../helpers/core-utils' |
9 | import { CONFIG, isEmailEnabled } from '../initializers/config' | 9 | import { CONFIG, isEmailEnabled } from '../initializers/config' |
@@ -19,7 +19,7 @@ import { | |||
19 | } from '../initializers/constants' | 19 | } from '../initializers/constants' |
20 | import { getThemeOrDefault } from '../lib/plugins/theme-utils' | 20 | import { getThemeOrDefault } from '../lib/plugins/theme-utils' |
21 | import { asyncMiddleware } from '../middlewares' | 21 | import { asyncMiddleware } from '../middlewares' |
22 | import { cacheRoute } from '../middlewares/cache' | 22 | import { cacheRoute } from '../middlewares/cache/cache' |
23 | import { UserModel } from '../models/user/user' | 23 | import { UserModel } from '../models/user/user' |
24 | import { VideoModel } from '../models/video/video' | 24 | import { VideoModel } from '../models/video/video' |
25 | import { VideoCommentModel } from '../models/video/video-comment' | 25 | import { VideoCommentModel } from '../models/video/video-comment' |
@@ -66,7 +66,7 @@ staticRouter.use( | |||
66 | 66 | ||
67 | // robots.txt service | 67 | // robots.txt service |
68 | staticRouter.get('/robots.txt', | 68 | staticRouter.get('/robots.txt', |
69 | asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.ROBOTS)), | 69 | cacheRoute(ROUTE_CACHE_LIFETIME.ROBOTS), |
70 | (_, res: express.Response) => { | 70 | (_, res: express.Response) => { |
71 | res.type('text/plain') | 71 | res.type('text/plain') |
72 | return res.send(CONFIG.INSTANCE.ROBOTS) | 72 | return res.send(CONFIG.INSTANCE.ROBOTS) |
@@ -86,7 +86,7 @@ staticRouter.get('/security.txt', | |||
86 | ) | 86 | ) |
87 | 87 | ||
88 | staticRouter.get('/.well-known/security.txt', | 88 | staticRouter.get('/.well-known/security.txt', |
89 | asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.SECURITYTXT)), | 89 | cacheRoute(ROUTE_CACHE_LIFETIME.SECURITYTXT), |
90 | (_, res: express.Response) => { | 90 | (_, res: express.Response) => { |
91 | res.type('text/plain') | 91 | res.type('text/plain') |
92 | return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT) | 92 | return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT) |
@@ -95,7 +95,7 @@ staticRouter.get('/.well-known/security.txt', | |||
95 | 95 | ||
96 | // nodeinfo service | 96 | // nodeinfo service |
97 | staticRouter.use('/.well-known/nodeinfo', | 97 | staticRouter.use('/.well-known/nodeinfo', |
98 | asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)), | 98 | cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO), |
99 | (_, res: express.Response) => { | 99 | (_, res: express.Response) => { |
100 | return res.json({ | 100 | return res.json({ |
101 | links: [ | 101 | links: [ |
@@ -108,13 +108,13 @@ staticRouter.use('/.well-known/nodeinfo', | |||
108 | } | 108 | } |
109 | ) | 109 | ) |
110 | staticRouter.use('/nodeinfo/:version.json', | 110 | staticRouter.use('/nodeinfo/:version.json', |
111 | asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.NODEINFO)), | 111 | cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO), |
112 | asyncMiddleware(generateNodeinfo) | 112 | asyncMiddleware(generateNodeinfo) |
113 | ) | 113 | ) |
114 | 114 | ||
115 | // dnt-policy.txt service (see https://www.eff.org/dnt-policy) | 115 | // dnt-policy.txt service (see https://www.eff.org/dnt-policy) |
116 | staticRouter.use('/.well-known/dnt-policy.txt', | 116 | staticRouter.use('/.well-known/dnt-policy.txt', |
117 | asyncMiddleware(cacheRoute()(ROUTE_CACHE_LIFETIME.DNT_POLICY)), | 117 | cacheRoute(ROUTE_CACHE_LIFETIME.DNT_POLICY), |
118 | (_, res: express.Response) => { | 118 | (_, res: express.Response) => { |
119 | res.type('text/plain') | 119 | res.type('text/plain') |
120 | 120 | ||