Fix wrong mimetypes for images
This commit is contained in:
parent
300d82a8ac
commit
147f16a262
2 changed files with 4 additions and 2 deletions
|
@ -55,6 +55,6 @@ routes:
|
||||||
extend status, ""
|
extend status, ""
|
||||||
extend media, ""
|
extend media, ""
|
||||||
|
|
||||||
settings.mimes.register("1500x500", "image/jpeg")
|
settings.mimes.register("jpg?name=orig", "image/jpeg")
|
||||||
|
|
||||||
runForever()
|
runForever()
|
||||||
|
|
|
@ -28,7 +28,9 @@ proc getPicUrl*(link: string): string =
|
||||||
|
|
||||||
proc cleanFilename*(filename: string): string =
|
proc cleanFilename*(filename: string): string =
|
||||||
const reg = re"[^A-Za-z0-9._-]"
|
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)] =
|
proc filterParams*(params: Table): seq[(string, string)] =
|
||||||
let filter = ["name", "id", "list", "referer"]
|
let filter = ["name", "id", "list", "referer"]
|
||||||
|
|
Loading…
Reference in a new issue