Makes the mime also work with upper case extension

Signed-off-by: pierreozoux <pierre@ozoux.net>
This commit is contained in:
pierreozoux 2020-09-29 19:12:29 +02:00
parent f862b7a1e4
commit afc801b1c3

View file

@ -7,7 +7,7 @@ exports.isSQLite = function isSQLite (sequelize) {
exports.getImageMimeType = function getImageMimeType (imagePath) { exports.getImageMimeType = function getImageMimeType (imagePath) {
var fileExtension = /[^.]+$/.exec(imagePath) var fileExtension = /[^.]+$/.exec(imagePath)
switch (fileExtension[0]) { switch (fileExtension[0].toLowerCase()) {
case 'bmp': case 'bmp':
return 'image/bmp' return 'image/bmp'
case 'gif': case 'gif':