[mirror of https://git.0x0.st/mia/0x0] No-bullshit file hosting and URL shortening service https://0x0.st

Fix handling double file name extensions

Long names would get truncated at the end, causing problems
including unresolvable file URLs. Example with default settings:
.package.lst → .package.

Fixes #61

Changed files
+2
+2
fhost.py
··· 218 218 219 219 def get_ext(mime): 220 220 ext = "".join(Path(file_.filename).suffixes[-2:]) 221 + if len(ext) > app.config["FHOST_MAX_EXT_LENGTH"]: 222 + ext = Path(file_.filename).suffixes[-1] 221 223 gmime = mime.split(";")[0] 222 224 guess = guess_extension(gmime) 223 225