mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Don't strip params from invalid video ids
This commit is contained in:
parent
6c71227766
commit
4f3d8a8ef6
1 changed files with 14 additions and 2 deletions
|
@ -179,7 +179,13 @@ get "/watch" do |env|
|
||||||
id = env.params.query["v"]
|
id = env.params.query["v"]
|
||||||
|
|
||||||
if id.size > 11
|
if id.size > 11
|
||||||
next env.redirect "/watch?v=#{id[0, 11]}"
|
url = "/watch?v=#{id[0, 11]}"
|
||||||
|
env.params.query.delete_all("v")
|
||||||
|
if env.params.query.size > 0
|
||||||
|
url += "&#{env.params.query}"
|
||||||
|
end
|
||||||
|
|
||||||
|
next env.redirect url
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
next env.redirect "/"
|
next env.redirect "/"
|
||||||
|
@ -292,7 +298,13 @@ get "/embed/:id" do |env|
|
||||||
id = env.params.url["id"]
|
id = env.params.url["id"]
|
||||||
|
|
||||||
if id.size > 11
|
if id.size > 11
|
||||||
next env.redirect "/embed/#{id[0, 11]}"
|
url = "/embed/#{id[0, 11]}"
|
||||||
|
|
||||||
|
if env.params.query.size > 0
|
||||||
|
url += "?#{env.params.query}"
|
||||||
|
end
|
||||||
|
|
||||||
|
next env.redirect url
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
next env.redirect "/"
|
next env.redirect "/"
|
||||||
|
|
Loading…
Reference in a new issue