mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Add redirect for missing params
This commit is contained in:
parent
8956623347
commit
225625a0fb
1 changed files with 12 additions and 2 deletions
|
@ -150,7 +150,12 @@ get "/" do |env|
|
||||||
end
|
end
|
||||||
|
|
||||||
get "/watch" do |env|
|
get "/watch" do |env|
|
||||||
id = env.params.query["v"]
|
if env.params.query["v"]?
|
||||||
|
id = env.params.query["v"]
|
||||||
|
else
|
||||||
|
env.redirect "/"
|
||||||
|
next
|
||||||
|
end
|
||||||
|
|
||||||
if env.params.query["listen"]? && env.params.query["listen"] == "true"
|
if env.params.query["listen"]? && env.params.query["listen"] == "true"
|
||||||
listen = true
|
listen = true
|
||||||
|
@ -246,7 +251,12 @@ get "/watch" do |env|
|
||||||
end
|
end
|
||||||
|
|
||||||
get "/search" do |env|
|
get "/search" do |env|
|
||||||
query = env.params.query["q"]
|
if env.params.query["q"]?
|
||||||
|
query = env.params.query["q"]
|
||||||
|
else
|
||||||
|
env.redirect "/"
|
||||||
|
next
|
||||||
|
end
|
||||||
page = env.params.query["page"]? && env.params.query["page"].to_i? ? env.params.query["page"].to_i : 1
|
page = env.params.query["page"]? && env.params.query["page"].to_i? ? env.params.query["page"].to_i : 1
|
||||||
|
|
||||||
client = get_client(pool)
|
client = get_client(pool)
|
||||||
|
|
Loading…
Reference in a new issue