diff options
author | Austin Heap <me@austinheap.com> | 2018-09-06 05:23:46 -0700 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2018-09-06 14:23:46 +0200 |
commit | 5447516b9a87725a6f8c55ec7e4ea1c1be839ee6 (patch) | |
tree | bb73829e0b2c179e717ff491c75d074ed38bb0e5 /server/controllers/static.ts | |
parent | 35c29307767ac773eaab5054071c7df0555effcb (diff) | |
download | PeerTube-5447516b9a87725a6f8c55ec7e4ea1c1be839ee6.tar.gz PeerTube-5447516b9a87725a6f8c55ec7e4ea1c1be839ee6.tar.zst PeerTube-5447516b9a87725a6f8c55ec7e4ea1c1be839ee6.zip |
draft "security.txt" spec integration (#1020)
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)), |