From 0fcfb7b82bf30377e09f61e7dca45e030fc0150a Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 23 Jan 2019 23:12:48 -0600 Subject: [PATCH] Add redirect for legacy '/profile' endpoint --- src/invidious.cr | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/invidious.cr b/src/invidious.cr index 7c98735f..7f77e317 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -2142,6 +2142,16 @@ get "/c/:user" do |env| env.redirect anchor["href"] end +# Legacy endpoint for /user/:username +get "/profile" do |env| + user = env.params.query["user"]? + if !user + env.redirect "/" + else + env.redirect "/user/#{user}" + end +end + get "/user/:user" do |env| user = env.params.url["user"] env.redirect "/channel/#{user}"