From e8ec9a8af4357b39c40953aec72845d42276a33c Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Thu, 4 Oct 2018 02:44:29 +0200 Subject: [PATCH] Enforce disabled index for static assets ExpressJS still does allow serving index.html files. This change disables that permanently. Signed-off-by: Sheogorath --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index c2e958a6..33956ce9 100644 --- a/app.js +++ b/app.js @@ -125,7 +125,7 @@ app.use(i18n.init) // routes without sessions // static files -app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime })) +app.use('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime, index: false })) app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { maxAge: config.staticCacheTime })) app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { maxAge: config.staticCacheTime })) app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), { maxAge: config.staticCacheTime }))