Disallow creation of robots.txt in freeurl

Add a configuration setting to "hard"-disable creation of notes as
set by the configuration value. This defaults to `['robots.txt',
'favicon.ico']`, because these files are often accidentally created
by bots and browsers.

This commit fixes #1052.

Signed-off-by: Daan Sprenkels <hello@dsprenkels.com>
This commit is contained in:
Daan Sprenkels
2018-11-13 00:14:25 +01:00
parent 54d3d930cf
commit 4bd8d7eb91
4 changed files with 5 additions and 1 deletions

View File

@@ -157,7 +157,7 @@ function findNote (req, res, callback, include) {
include: include || null
}).then(function (note) {
if (!note) {
if (config.allowFreeURL && noteId) {
if (config.allowFreeURL && noteId && !config.forbiddenNoteIDs.includes(noteId)) {
req.alias = noteId
return newNote(req, res)
} else {