summaryrefslogtreecommitdiff
path: root/fhost.py
diff options
context:
space:
mode:
authorAlexey Sakovets <alexeysakovets@gmail.com>2022-01-01 23:46:41 +0300
committerAlexey Sakovets <alexeysakovets@gmail.com>2022-01-01 23:46:41 +0300
commit0db6e4b89507ad1db502b63044544b864e1038c1 (patch)
treec66095f40a55e62a4ab8e7e2a5dbfb8732f08dae /fhost.py
parent9c4a0fd5a6de5a1b15444171559e9dce0a2fa578 (diff)
Fix mime splitting
mime[:mime.find(";")] will remove last character if mime does not contain ";". Use mime.split(";") instead.
Diffstat (limited to 'fhost.py')
-rwxr-xr-xfhost.py2
1 files changed, 1 insertions, 1 deletions
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}'")