mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:35:38 -04:00
Add error message for empty 'v' param
This commit is contained in:
parent
4e33d3a0b9
commit
570e09333a
@ -212,9 +212,14 @@ get "/watch" do |env|
|
|||||||
next env.redirect url
|
next env.redirect url
|
||||||
end
|
end
|
||||||
|
|
||||||
if env.params.query["v"]? && !env.params.query["v"].empty?
|
if env.params.query["v"]?
|
||||||
id = env.params.query["v"]
|
id = env.params.query["v"]
|
||||||
|
|
||||||
|
if env.params.query["v"].empty?
|
||||||
|
error_message = "Invalid parameters."
|
||||||
|
next templated "error"
|
||||||
|
end
|
||||||
|
|
||||||
if id.size > 11
|
if id.size > 11
|
||||||
url = "/watch?v=#{id[0, 11]}"
|
url = "/watch?v=#{id[0, 11]}"
|
||||||
env.params.query.delete_all("v")
|
env.params.query.delete_all("v")
|
||||||
|
Loading…
Reference in New Issue
Block a user