mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Fix host in redirect
This commit is contained in:
parent
61769c6f9c
commit
eee973fe86
1 changed files with 4 additions and 2 deletions
|
@ -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 += "®ion=#{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 += "®ion=#{region}"
|
||||
|
|
Loading…
Reference in a new issue