mirror of
https://github.com/zedeus/nitter.git
synced 2024-10-31 22:08:50 +00:00
Fix exception when image path is empty
This commit is contained in:
parent
510abb9b50
commit
a56f217074
1 changed files with 3 additions and 0 deletions
|
@ -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