diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-03-03 18:18:03 -0600 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-03-03 18:18:03 -0600 |
| commit | cf9931e2a1752455a55ff3e6b4063a66d089d26f (patch) | |
| tree | e6b9fc83e80265a16d10819a81f6dd438eabf417 /src | |
| parent | fc2e10a54f21ba0c4d95b867f4b6edd16fbe985b (diff) | |
| download | invidious-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.cr | 8 |
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" |
