summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-06 19:28:16 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-06 19:28:16 -0500
commit4f3d8a8ef641ab48b9dbffb6292b3d260cb15f9f (patch)
tree2957f0f6aec532e820a491509eec6d1712052d59
parent6c71227766ce43b5ae9738cd37c128dd9c7349f5 (diff)
downloadinvidious-4f3d8a8ef641ab48b9dbffb6292b3d260cb15f9f.tar.gz
invidious-4f3d8a8ef641ab48b9dbffb6292b3d260cb15f9f.tar.bz2
invidious-4f3d8a8ef641ab48b9dbffb6292b3d260cb15f9f.zip
Don't strip params from invalid video ids
-rw-r--r--src/invidious.cr16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index df3d4cfe..6cdfc811 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -179,7 +179,13 @@ get "/watch" do |env|
id = env.params.query["v"]
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
else
next env.redirect "/"
@@ -292,7 +298,13 @@ get "/embed/:id" do |env|
id = env.params.url["id"]
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
else
next env.redirect "/"