mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
Made it so user doesn't need to specify blockedExtensions.
This is useful if there are people already running lolisafe and updated to latest version
This commit is contained in:
parent
14cf45c168
commit
e2885bd37c
@ -22,8 +22,11 @@ const upload = multer({
|
||||
storage: storage,
|
||||
limits: { fileSize: config.uploads.maxSize },
|
||||
fileFilter: function(req, file, cb) {
|
||||
if (config.blockedExtensions.some(extension => path.extname(file.originalname) === extension)) {
|
||||
return cb('This file extension is not allowed');
|
||||
if (config.blockedExtensions !== undefined) {
|
||||
if (config.blockedExtensions.some(extension => path.extname(file.originalname) === extension)) {
|
||||
return cb('This file extension is not allowed');
|
||||
}
|
||||
return cb(null, true);
|
||||
}
|
||||
return cb(null, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user