Fix mime splitting
mime[:mime.find(";")] will remove last character if mime does not contain ";". Use mime.split(";") instead.
This commit is contained in:
parent
9c4a0fd5a6
commit
0db6e4b895
2
fhost.py
2
fhost.py
|
@ -162,7 +162,7 @@ class File(db.Model):
|
||||||
|
|
||||||
def get_ext(mime):
|
def get_ext(mime):
|
||||||
ext = "".join(Path(file_.filename).suffixes[-2:])
|
ext = "".join(Path(file_.filename).suffixes[-2:])
|
||||||
gmime = mime[:mime.find(";")]
|
gmime = mime.split(";")[0]
|
||||||
guess = guess_extension(gmime)
|
guess = guess_extension(gmime)
|
||||||
|
|
||||||
app.logger.debug(f"extension - specified: '{ext}' - detected: '{guess}'")
|
app.logger.debug(f"extension - specified: '{ext}' - detected: '{guess}'")
|
||||||
|
|
Loading…
Reference in New Issue