Fix wrong mimetypes for images

This commit is contained in:
Zed 2019-10-21 07:22:24 +02:00
parent 300d82a8ac
commit 147f16a262
2 changed files with 4 additions and 2 deletions

View File

@ -55,6 +55,6 @@ routes:
extend status, ""
extend media, ""
settings.mimes.register("1500x500", "image/jpeg")
settings.mimes.register("jpg?name=orig", "image/jpeg")
runForever()

View File

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