summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-03-03 18:18:03 -0600
committerOmar Roth <omarroth@hotmail.com>2018-03-03 18:18:03 -0600
commitcf9931e2a1752455a55ff3e6b4063a66d089d26f (patch)
treee6b9fc83e80265a16d10819a81f6dd438eabf417 /src
parentfc2e10a54f21ba0c4d95b867f4b6edd16fbe985b (diff)
downloadinvidious-cf9931e2a1752455a55ff3e6b4063a66d089d26f.tar.gz
invidious-cf9931e2a1752455a55ff3e6b4063a66d089d26f.tar.bz2
invidious-cf9931e2a1752455a55ff3e6b4063a66d089d26f.zip
Add support for redirect in URL description
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index dbd21adf..943259f2 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -334,6 +334,14 @@ get "/search" do |env|
templated "search"
end
+get "/redirect" do |env|
+ if env.params.query["q"]?
+ env.redirect env.params.query["q"]
+ else
+ env.redirect "/"
+ end
+end
+
error 404 do |env|
error_message = "404 Page not found"
templated "error"