From 679e6549ea54757bb41bc83a1ad1d37773528e5c Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 6 Aug 2021 10:58:40 +0100 Subject: [PATCH] Don't check the mimetype via content.file.mimetype This field is not actually specced. The specced field is at content.info.mimetype, which isn't currently sent to the content scanner. We check the mimetype of the file by scanning it. As issue #49 mentions, this check is not infallible, but that should be fixed separately. --- src/reporting.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/reporting.js b/src/reporting.js index 4187299..c678c77 100644 --- a/src/reporting.js +++ b/src/reporting.js @@ -313,12 +313,6 @@ async function generateReport(console, httpUrl, matrixFile, filePath, tempDir, s if (matrixFile && matrixFile.key) { console.info(`Decrypting ${filePath}, writing to ${decryptedFilePath}`); - console.info(`FileType: ${matrixFile.mimetype} [${filePath}]`); - - // Do an initial check of the mimetype based on what is reported by the client - if (mimetypeArray && !mimetypeArray.includes(matrixFile.mimetype)) { - return {clean: false, info: 'File type not supported'}; - } // Decrypt the file let decryptedFileContents;