From e86eb16d915dfaa9685ecad5c5570e468b818556 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Mon, 11 Mar 2019 16:17:40 -0500 Subject: [PATCH] Add temporary fix for crystal-lang/crystal#7383 --- src/invidious.cr | 2 +- src/invidious/helpers/helpers.cr | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/invidious.cr b/src/invidious.cr index 3e5c4d5e..4fe018f9 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -4230,7 +4230,7 @@ get "/videoplayback" do |env| url = "/videoplayback?#{query_params.to_s}" headers = HTTP::Headers.new - {"Range", "Accept", "Accept-Encoding"}.each do |header| + {"Accept", "Accept-Encoding", "Connection", "Range"}.each do |header| if env.request.headers[header]? headers[header] = env.request.headers[header] end diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 075bf84e..1cd40d41 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -75,6 +75,14 @@ class DenyFrame < Kemal::Handler end end +# Temp fix for https://github.com/crystal-lang/crystal/issues/7383 +class HTTP::Client + private def handle_response(response) + # close unless response.keep_alive? + response + end +end + def rank_videos(db, n) top = [] of {Float64, String}