summaryrefslogtreecommitdiff
path: root/lib/web
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lib/web/imageRouter/index.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/web/imageRouter/index.js b/lib/web/imageRouter/index.js
index b5c486c3..f456fd30 100644
--- a/lib/web/imageRouter/index.js
+++ b/lib/web/imageRouter/index.js
@@ -23,6 +23,9 @@ imageRouter.post('/uploadimage', function (req, res) {
if (err) {
logger.error(`formidable error: ${err}`)
return errors.errorForbidden(res)
+ } else if (!req.isAuthenticated() && !config.allowAnonymous && !config.allowAnonymousEdits) {
+ logger.error(`formidable error: Anonymous edits and therefore uploads are not allowed)`)
+ return errors.errorForbidden(res)
} else if (!files.image || !files.image.path) {
logger.error(`formidable error: Upload didn't contain file)`)
return errors.errorBadRequest(res)