summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-01-23 23:12:48 -0600
committerOmar Roth <omarroth@hotmail.com>2019-01-23 23:12:48 -0600
commit0fcfb7b82bf30377e09f61e7dca45e030fc0150a (patch)
tree6249a6b60734d641a1d703fed82ef2cacb14a932 /src
parent30f08ae48c1edc7beb2406bc18140e0b7b5254da (diff)
downloadinvidious-0fcfb7b82bf30377e09f61e7dca45e030fc0150a.tar.gz
invidious-0fcfb7b82bf30377e09f61e7dca45e030fc0150a.tar.bz2
invidious-0fcfb7b82bf30377e09f61e7dca45e030fc0150a.zip
Add redirect for legacy '/profile' endpoint
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr10
1 files changed, 10 insertions, 0 deletions
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}"