fix: check known_tabs against downcased selected_tab

This commit is contained in:
Cameron Radmore 2026-07-19 17:32:12 -04:00
parent b8026934a0
commit 492eab04e3
No known key found for this signature in database
GPG Key ID: 51E32B9B64747796

View File

@ -338,7 +338,7 @@ module Invidious::Routes::Channels
def self.potential_brand_redirect(env) def self.potential_brand_redirect(env)
# Check for known tab in url before trying to brand_redirect (avoids unneeded request to YouTube) # Check for known tab in url before trying to brand_redirect (avoids unneeded request to YouTube)
selected_tab = env.params.url["tab"]? selected_tab = env.params.url["tab"]?.try &.downcase
if KNOWN_TABS.includes? selected_tab if KNOWN_TABS.includes? selected_tab
brand_redirect(env) brand_redirect(env)
@ -369,7 +369,7 @@ module Invidious::Routes::Channels
return error_template(404, I18n.translate(locale, "This channel does not exist.")) return error_template(404, I18n.translate(locale, "This channel does not exist."))
end end
selected_tab = env.params.url["tab"]? selected_tab = env.params.url["tab"]?.try &.downcase
if KNOWN_TABS.includes? selected_tab if KNOWN_TABS.includes? selected_tab
url = "/channel/#{ucid}/#{selected_tab}" url = "/channel/#{ucid}/#{selected_tab}"