From 093ff6f209e9b9510bea63658ad2b779cc95a819 Mon Sep 17 00:00:00 2001 From: daniel-j Date: Wed, 6 Dec 2023 16:59:23 +0100 Subject: [PATCH] skip mimetype detection if octet-stream --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 7249fab..f65fadf 100644 --- a/index.js +++ b/index.js @@ -101,7 +101,7 @@ const upload = multer({ cb(null, false) return } - if (!allowedTypes.includes(file.mimetype) || !allowedExtensions.includes(extname(file.originalname.toLowerCase()).substring(1))) { + if ((!allowedTypes.includes(file.mimetype) && file.mimetype != "application/octet-stream") || !allowedExtensions.includes(extname(file.originalname.toLowerCase()).substring(1))) { console.error('FileFilter: File is of an invalid type ', file) cb(null, false) return