diff options
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r-- | server/controllers/static.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index df31c3134..63f78b3b3 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts | |||
@@ -79,6 +79,21 @@ staticRouter.get('/robots.txt', | |||
79 | } | 79 | } |
80 | ) | 80 | ) |
81 | 81 | ||
82 | // security.txt service | ||
83 | staticRouter.get('/security.txt', | ||
84 | (_, res: express.Response) => { | ||
85 | return res.redirect(301, '/.well-known/security.txt') | ||
86 | } | ||
87 | ) | ||
88 | |||
89 | staticRouter.get('/.well-known/security.txt', | ||
90 | asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.SECURITYTXT)), | ||
91 | (_, res: express.Response) => { | ||
92 | res.type('text/plain') | ||
93 | return res.send(CONFIG.INSTANCE.SECURITYTXT + CONFIG.INSTANCE.SECURITYTXT_CONTACT) | ||
94 | } | ||
95 | ) | ||
96 | |||
82 | // nodeinfo service | 97 | // nodeinfo service |
83 | staticRouter.use('/.well-known/nodeinfo', | 98 | staticRouter.use('/.well-known/nodeinfo', |
84 | asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)), | 99 | asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)), |