mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-22 23:15:33 +00:00
Fix exception when image path is empty
This commit is contained in:
parent
510abb9b50
commit
a56f217074
|
@ -21,6 +21,9 @@ proc createMediaRouter*(cfg: Config) =
|
|||
let path = uri.path.split("/")[2 .. ^1].join("/")
|
||||
let filename = cfg.cacheDir / cleanFilename(path & uri.query)
|
||||
|
||||
if path.len == 0:
|
||||
resp Http404
|
||||
|
||||
if not existsDir(cfg.cacheDir):
|
||||
createDir(cfg.cacheDir)
|
||||
|
||||
|
|
Loading…
Reference in a new issue