summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-03-27 15:25:08 -0500
committerOmar Roth <omarroth@hotmail.com>2019-03-27 15:25:08 -0500
commiteee973fe86f23b422363690e8edaf92a04a7d228 (patch)
tree67101ecc2e510dd915e9d7446614c4f261e826dd
parent61769c6f9cda464a179dd6da60aecfd8fce26663 (diff)
downloadinvidious-eee973fe86f23b422363690e8edaf92a04a7d228.tar.gz
invidious-eee973fe86f23b422363690e8edaf92a04a7d228.tar.bz2
invidious-eee973fe86f23b422363690e8edaf92a04a7d228.zip
Fix host in redirect
-rw-r--r--src/invidious.cr6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index d375b6aa..a5f5196d 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -4240,10 +4240,11 @@ get "/videoplayback" do |env|
if response.headers["Location"]?
url = URI.parse(response.headers["Location"])
+ host = url.host
env.response.headers["Access-Control-Allow-Origin"] = "*"
url = url.full_path
- url += "&host=#{host.lchop("https://")}"
+ url += "&host=#{host}"
if region
url += "&region=#{region}"
@@ -4267,10 +4268,11 @@ get "/videoplayback" do |env|
if response.headers["Location"]?
url = URI.parse(response.headers["Location"])
+ host = url.host
env.response.headers["Access-Control-Allow-Origin"] = "*"
url = url.full_path
- url += "&host=#{host.lchop("https://")}"
+ url += "&host=#{host}"
if region
url += "&region=#{region}"