From d4693c5bfa0b056edc1b8a6defe06bd086d05dbd Mon Sep 17 00:00:00 2001 From: Andrew Arkhipov Date: Fri, 25 Sep 2020 15:25:21 +0300 Subject: [PATCH 1/2] Fix mime error --- File.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/File.js b/File.js index 5537d71..c25df43 100644 --- a/File.js +++ b/File.js @@ -34,7 +34,7 @@ if (!self.name) { throw new Error("No name"); } - self.type = self.type || mime.lookup(self.name); + self.type = self.type || mime.getType(self.name); if (!self.path) { if (self.buffer) { From 853f6838a7acd53d91ba3a2265b7ec53f7929204 Mon Sep 17 00:00:00 2001 From: Andrew Arkhipov Date: Fri, 25 Sep 2020 23:33:27 +0300 Subject: [PATCH 2/2] Update File.js --- File.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/File.js b/File.js index c25df43..4a9d869 100644 --- a/File.js +++ b/File.js @@ -34,7 +34,14 @@ if (!self.name) { throw new Error("No name"); } - self.type = self.type || mime.getType(self.name); + + try { + self.type = self.type || mime.lookup(self.name) + } catch {} + + try { + self.type = self.type || mime.getType(self.name) + } catch {} if (!self.path) { if (self.buffer) {