Fix typo in '/videoplayback'

pull/633/head
Omar Roth 2019-06-26 15:03:09 -05:00
rodzic ebfd7d2153
commit 9d2982fcd7
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B8254FB7EC3D37F2
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -4651,11 +4651,10 @@ get "/videoplayback" do |env|
begin begin
range_begin, range_end = parse_range(env.request.headers["Range"]?) range_begin, range_end = parse_range(env.request.headers["Range"]?)
client = make_client(URI.parse(host), proxies, region)
(range_begin...range_end).each_slice(HTTP_CHUNK_SIZE) do |slice| (range_begin...range_end).each_slice(HTTP_CHUNK_SIZE) do |slice|
headers["Range"] = "bytes=#{slice[0]}-#{slice[-1]}" headers["Range"] = "bytes=#{slice[0]}-#{slice[-1]}"
begin begin
client = make_client(URI.parse(host), proxies, region)
client.get(url, headers) do |response| client.get(url, headers) do |response|
content_range = response.headers["Content-Range"].lchop("bytes ") content_range = response.headers["Content-Range"].lchop("bytes ")
content_size = content_range.split("/")[-1].to_i content_size = content_range.split("/")[-1].to_i