From 4d62e6b0b588d53ab1b4f163f946c9be39f1b301 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Wed, 18 Sep 2019 22:18:22 +0200 Subject: [PATCH 1/2] Fixed #179 (redirect loop with a trailing slash) Signed-off-by: Erik Michelson --- app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 811696ece..f2db18152 100644 --- a/app.js +++ b/app.js @@ -126,9 +126,9 @@ app.use(i18n.init) // routes without sessions // static files -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('/', express.static(path.join(__dirname, '/public'), { maxAge: config.staticCacheTime, index: false, redirect: false })) +app.use('/docs', express.static(path.resolve(__dirname, config.docsPath), { maxAge: config.staticCacheTime, redirect: false })) +app.use('/uploads', express.static(path.resolve(__dirname, config.uploadsPath), { maxAge: config.staticCacheTime, redirect: false })) app.use('/default.md', express.static(path.resolve(__dirname, config.defaultNotePath), { maxAge: config.staticCacheTime })) // session From 9e1cc2159f115f818174d1346d4874b0e7e0be5c Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Wed, 18 Sep 2019 22:54:08 +0200 Subject: [PATCH 2/2] Updated forbiddenNoteIDs Signed-off-by: Erik Michelson --- lib/config/default.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config/default.js b/lib/config/default.js index 12254d472..19bbeb215 100644 --- a/lib/config/default.js +++ b/lib/config/default.js @@ -32,7 +32,7 @@ module.exports = { allowAnonymous: true, allowAnonymousEdits: false, allowFreeURL: false, - forbiddenNoteIDs: ['robots.txt', 'favicon.ico', 'api'], + forbiddenNoteIDs: ['robots.txt', 'favicon.ico', 'api', 'build', 'css', 'docs', 'fonts', 'js', 'uploads', 'vendor', 'views'], defaultPermission: 'editable', dbURL: '', db: {},