Merge pull request #2011 from syeopite/video-alias-url-params

Preserve url params in video route aliases
This commit is contained in:
TheFrenchGhosty 2021-04-13 18:07:13 +00:00 committed by GitHub
commit edb37c95e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -189,6 +189,11 @@ class Invidious::Routes::Watch < Invidious::Routes::BaseRoute
end
def redirect(env)
return env.redirect "/watch?v=#{env.params.url["id"]}"
url = "/watch?v=#{env.params.url["id"]}"
if env.params.query.size > 0
url += "&#{env.params.query}"
end
return env.redirect url
end
end