mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
.txt.gz is not actually .txt
This commit is contained in:
parent
4d0c6a8802
commit
977f09c470
|
@ -1280,7 +1280,14 @@ def guess_mime(url, fallback="application/octet-stream"):
|
|||
except:
|
||||
return fallback
|
||||
|
||||
ret = MIMES.get(ext) or mimetypes.guess_type(url)[0] or fallback
|
||||
ret = MIMES.get(ext)
|
||||
|
||||
if not ret:
|
||||
x = mimetypes.guess_type(url)
|
||||
ret = "application/{}".format(x[1]) if x[1] else x[0]
|
||||
|
||||
if not ret:
|
||||
ret = fallback
|
||||
|
||||
if ";" not in ret:
|
||||
if ret.startswith("text/") or ret.endswith("/javascript"):
|
||||
|
|
Loading…
Reference in a new issue