Skip to content

Commit b0a5ffd

Browse files
committed
Changed validate check to enumerated file type
1 parent 1a799f1 commit b0a5ffd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/fileinfo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = function (options) {
1616
this.error = 'File is too small';
1717
} else if (options.maxFileSize && options.maxFileSize < this.size) {
1818
this.error = 'File is too big';
19-
} else if (!options.acceptFileTypes.test(this.name)) {
19+
} else if (_.indexOf(options.acceptFileTypes, this.type === -1) {
2020
this.error = 'Filetype not allowed';
2121
}
2222
return !this.error;
@@ -39,4 +39,4 @@ module.exports = function (options) {
3939
}
4040

4141
return FileInfo;
42-
};
42+
};

0 commit comments

Comments
 (0)