From 0db6e4b89507ad1db502b63044544b864e1038c1 Mon Sep 17 00:00:00 2001 From: Alexey Sakovets Date: Sat, 1 Jan 2022 23:46:41 +0300 Subject: [PATCH] Fix mime splitting mime[:mime.find(";")] will remove last character if mime does not contain ";". Use mime.split(";") instead. --- fhost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fhost.py b/fhost.py index c70ed17..8e5b100 100755 --- a/fhost.py +++ b/fhost.py @@ -162,7 +162,7 @@ class File(db.Model): def get_ext(mime): ext = "".join(Path(file_.filename).suffixes[-2:]) - gmime = mime[:mime.find(";")] + gmime = mime.split(";")[0] guess = guess_extension(gmime) app.logger.debug(f"extension - specified: '{ext}' - detected: '{guess}'")