aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorAustin Heap <me@austinheap.com>2018-09-06 05:23:46 -0700
committerRigel Kent <par@rigelk.eu>2018-09-06 14:23:46 +0200
commit5447516b9a87725a6f8c55ec7e4ea1c1be839ee6 (patch)
treebb73829e0b2c179e717ff491c75d074ed38bb0e5 /server/controllers
parent35c29307767ac773eaab5054071c7df0555effcb (diff)
downloadPeerTube-5447516b9a87725a6f8c55ec7e4ea1c1be839ee6.tar.gz
PeerTube-5447516b9a87725a6f8c55ec7e4ea1c1be839ee6.tar.zst
PeerTube-5447516b9a87725a6f8c55ec7e4ea1c1be839ee6.zip
draft "security.txt" spec integration (#1020)
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/static.ts15
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
83staticRouter.get('/security.txt',
84 (_, res: express.Response) => {
85 return res.redirect(301, '/.well-known/security.txt')
86 }
87)
88
89staticRouter.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
83staticRouter.use('/.well-known/nodeinfo', 98staticRouter.use('/.well-known/nodeinfo',
84 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)), 99 asyncMiddleware(cacheRoute(ROUTE_CACHE_LIFETIME.NODEINFO)),