فهرست منبع

Fix video endpoint not closing client

Zed 7 سال پیش
والد
کامیت
0b52f4963c
1فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 3 4
      src/nitter.nim

+ 3 - 4
src/nitter.nim

@@ -184,11 +184,10 @@ routes:
     if getHmac(url) != @"sig":
       resp showError("Failed to verify signature", cfg.title, prefs)
 
-    let
-      client = newAsyncHttpClient()
-      video = await client.getContent(url)
+    let client = newAsyncHttpClient()
+    let video = await client.getContent(url)
+    client.close()
 
-    defer: client.close()
     resp video, mimetype(url)
 
 runForever()