Make image upload resilient to crashes
This commit is contained in:
parent
2f51de90d0
commit
12cf772616
|
@ -70,7 +70,12 @@ routes:
|
|||
await client.downloadFile($uri, filename)
|
||||
client.close()
|
||||
|
||||
sendFile(filename)
|
||||
if not existsFile(filename):
|
||||
resp Http404
|
||||
|
||||
let file = openAsync(filename)
|
||||
defer: file.close()
|
||||
resp await readAll(file), mimetype(filename)
|
||||
|
||||
get "/video/@sig/@url":
|
||||
cond "http" in @"url"
|
||||
|
|
Loading…
Reference in New Issue