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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user