Fix redirect for attribution_links

This commit is contained in:
syeopite 2021-06-28 22:29:00 -07:00
parent 36a4647fba
commit 9962964f48
No known key found for this signature in database
GPG Key ID: 6FA616E5A5294A82

View File

@ -106,7 +106,7 @@ class Invidious::Routes::Channels < Invidious::Routes::BaseRoute
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
begin
resolved_url = YoutubeAPI.resolve_url("https://youtube.com#{env.request.path}")
resolved_url = YoutubeAPI.resolve_url("https://youtube.com#{env.request.path}#{env.params.query.size > 0 ? "?#{env.params.query}" : ""}")
rescue ex : InfoException
raise InfoException.new("This channel does not exist.")
end
@ -120,10 +120,6 @@ class Invidious::Routes::Channels < Invidious::Routes::BaseRoute
url = "/channel/#{ucid}"
end
if env.params.query.size > 0
url += "?#{env.params.query}"
end
env.redirect url
end