Proper mimetype fix

This commit is contained in:
Zed 2019-10-21 07:33:45 +02:00
parent 147f16a262
commit 030d649300
2 changed files with 1 additions and 5 deletions

View File

@ -54,7 +54,3 @@ routes:
extend list, ""
extend status, ""
extend media, ""
settings.mimes.register("jpg?name=orig", "image/jpeg")
runForever()

View File

@ -29,7 +29,7 @@ proc getPicUrl*(link: string): string =
proc cleanFilename*(filename: string): string =
const reg = re"[^A-Za-z0-9._-]"
result = filename.replace(reg, "_")
if "1500x500" in result:
if "1500x500" in result or "name_orig" in result:
result &= ".jpg"
proc filterParams*(params: Table): seq[(string, string)] =