mirror of
https://github.com/zedeus/nitter.git
synced 2024-12-13 03:26:30 +00:00
Actually close files after uploading
This commit is contained in:
parent
6a058a8c5c
commit
afdbb6ad9e
1 changed files with 4 additions and 3 deletions
|
@ -59,7 +59,7 @@ settings:
|
||||||
|
|
||||||
routes:
|
routes:
|
||||||
get "/":
|
get "/":
|
||||||
resp renderMain(renderSearch(), title=cfg.title, titleText="Search")
|
resp renderMain(renderSearch(), title=cfg.title)
|
||||||
|
|
||||||
post "/search":
|
post "/search":
|
||||||
if @"query".len == 0:
|
if @"query".len == 0:
|
||||||
|
@ -117,9 +117,10 @@ routes:
|
||||||
resp Http404
|
resp Http404
|
||||||
|
|
||||||
let file = openAsync(filename)
|
let file = openAsync(filename)
|
||||||
defer: file.close()
|
let buf = await readAll(file)
|
||||||
|
file.close()
|
||||||
|
|
||||||
resp await readAll(file), mimetype(filename)
|
resp buf, mimetype(filename)
|
||||||
|
|
||||||
get "/video/@sig/@url":
|
get "/video/@sig/@url":
|
||||||
cond "http" in @"url"
|
cond "http" in @"url"
|
||||||
|
|
Loading…
Reference in a new issue