mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-23 11:15:46 +00:00
Proper mimetype fix
This commit is contained in:
parent
147f16a262
commit
030d649300
|
@ -54,7 +54,3 @@ routes:
|
||||||
extend list, ""
|
extend list, ""
|
||||||
extend status, ""
|
extend status, ""
|
||||||
extend media, ""
|
extend media, ""
|
||||||
|
|
||||||
settings.mimes.register("jpg?name=orig", "image/jpeg")
|
|
||||||
|
|
||||||
runForever()
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ 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._-]"
|
||||||
result = filename.replace(reg, "_")
|
result = filename.replace(reg, "_")
|
||||||
if "1500x500" in result:
|
if "1500x500" in result or "name_orig" in result:
|
||||||
result &= ".jpg"
|
result &= ".jpg"
|
||||||
|
|
||||||
proc filterParams*(params: Table): seq[(string, string)] =
|
proc filterParams*(params: Table): seq[(string, string)] =
|
||||||
|
|
Loading…
Reference in a new issue