summaryrefslogtreecommitdiffstats
path: root/app/core/files.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/core/files.js')
-rw-r--r--app/core/files.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/core/files.js b/app/core/files.js
index f4d6674..5565a19 100644
--- a/app/core/files.js
+++ b/app/core/files.js
@@ -23,6 +23,12 @@ FileManager.prototype.create = function(options, cb) {
return cb('Files are disabled.');
}
+ if (settings.allowed_file_types &&
+ settings.allowed_file_types.length &&
+ !_.include(settings.allowed_file_types, options.file.type)) {
+ return cb('The MIME type ' + options.file.type + ' is not allowed');
+ }
+
Room.findById(options.room, function(err, room) {
if (err) {
console.error(err);