mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
fix potential memory leak
This commit is contained in:
parent
6488794218
commit
090b470bfc
1 changed files with 1 additions and 0 deletions
|
@ -37,6 +37,7 @@ module Invidious::Routes::API::V1::Search
|
||||||
url = "/complete/search?client=youtube&hl=en&gl=#{region}&q=#{URI.encode_www_form(query)}&gs_ri=youtube&ds=yt"
|
url = "/complete/search?client=youtube&hl=en&gl=#{region}&q=#{URI.encode_www_form(query)}&gs_ri=youtube&ds=yt"
|
||||||
|
|
||||||
response = client.get(url).body
|
response = client.get(url).body
|
||||||
|
client.close
|
||||||
|
|
||||||
body = JSON.parse(response[19..-2]).as_a
|
body = JSON.parse(response[19..-2]).as_a
|
||||||
suggestions = body[1].as_a[0..-2]
|
suggestions = body[1].as_a[0..-2]
|
||||||
|
|
Loading…
Reference in a new issue