mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 14:03:37 +00:00
Routes: Redirect unknown channel tabs to channel home page
This commit is contained in:
parent
2425c47882
commit
ebee973b24
@ -1,6 +1,12 @@
|
|||||||
{% skip_file if flag?(:api_only) %}
|
{% skip_file if flag?(:api_only) %}
|
||||||
|
|
||||||
module Invidious::Routes::Channels
|
module Invidious::Routes::Channels
|
||||||
|
# Redirection for unsupported routes ("tabs")
|
||||||
|
def self.redirect_home(env)
|
||||||
|
ucid = env.params.url["ucid"]
|
||||||
|
return env.redirect "/channel/#{URI.encode_www_form(ucid)}"
|
||||||
|
end
|
||||||
|
|
||||||
def self.home(env)
|
def self.home(env)
|
||||||
self.videos(env)
|
self.videos(env)
|
||||||
end
|
end
|
||||||
|
@ -131,7 +131,7 @@ module Invidious::Routing
|
|||||||
|
|
||||||
# Channel catch-all, to redirect future routes to the channel's home
|
# Channel catch-all, to redirect future routes to the channel's home
|
||||||
# NOTE: defined last in order to be processed after the other routes
|
# NOTE: defined last in order to be processed after the other routes
|
||||||
get "/channel/:ucid/*", Routes::Channels, :home
|
get "/channel/:ucid/*", Routes::Channels, :redirect_home
|
||||||
|
|
||||||
# /c/LinusTechTips
|
# /c/LinusTechTips
|
||||||
get "/c/:user", Routes::Channels, :brand_redirect
|
get "/c/:user", Routes::Channels, :brand_redirect
|
||||||
|
Loading…
Reference in New Issue
Block a user