From b0d0912ff9b6cd6c1b1ee28fefa9a2be7645bd89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 5 Nov 2015 10:34:03 +0100 Subject: [PATCH] Skip the known extension check if mimetypes fails. --- bin/filecheck.py | 2 +- bin/generic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/filecheck.py b/bin/filecheck.py index 86ec8d7..d9677b7 100644 --- a/bin/filecheck.py +++ b/bin/filecheck.py @@ -109,7 +109,7 @@ class File(FileBase): if aliases.get(mimetype) is not None: mimetype = aliases.get(mimetype) expected_extensions = mimetypes.guess_all_extensions(mimetype, strict=False) - if expected_extensions is not None: + if expected_extensions: if len(self.extension) > 0 and self.extension not in expected_extensions: self.log_details.update({'expected_extensions': expected_extensions}) self.make_dangerous() diff --git a/bin/generic.py b/bin/generic.py index 845b34e..120613f 100644 --- a/bin/generic.py +++ b/bin/generic.py @@ -85,7 +85,7 @@ class File(FileBase): if aliases.get(mimetype) is not None: mimetype = aliases.get(mimetype) expected_extensions = mimetypes.guess_all_extensions(mimetype, strict=False) - if expected_extensions is not None: + if expected_extensions: if len(self.extension) > 0 and self.extension not in expected_extensions: self.log_details.update({'expected_extensions': expected_extensions}) self.make_dangerous()