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 New Issue