summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-03-11 16:17:40 -0500
committerOmar Roth <omarroth@hotmail.com>2019-03-11 16:17:40 -0500
commite86eb16d915dfaa9685ecad5c5570e468b818556 (patch)
tree5240a205dd4075025251040127fb56b8a161584d
parent1fcd1ff3e8ee1a300431bb24392733b632d41cce (diff)
downloadinvidious-e86eb16d915dfaa9685ecad5c5570e468b818556.tar.gz
invidious-e86eb16d915dfaa9685ecad5c5570e468b818556.tar.bz2
invidious-e86eb16d915dfaa9685ecad5c5570e468b818556.zip
Add temporary fix for crystal-lang/crystal#7383
-rw-r--r--src/invidious.cr2
-rw-r--r--src/invidious/helpers/helpers.cr8
2 files changed, 9 insertions, 1 deletions
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}