summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-07-29 21:05:40 -0500
committerOmar Roth <omarroth@hotmail.com>2018-07-29 21:05:40 -0500
commit714fd3dae3b141aa0ec878e23bc542ce371299fb (patch)
tree6f13dde3a461554f8dda32d4b1605426c3ab34b7 /src
parenta09b12a77498771bc0bd326270ad01f5cc78aec4 (diff)
downloadinvidious-714fd3dae3b141aa0ec878e23bc542ce371299fb.tar.gz
invidious-714fd3dae3b141aa0ec878e23bc542ce371299fb.tar.bz2
invidious-714fd3dae3b141aa0ec878e23bc542ce371299fb.zip
Add 'results' route redirect
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index a61bb375..3b42c443 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -1329,6 +1329,15 @@ get "/embed/:id" do |env|
rendered "embed"
end
+get "/results" do |env|
+ search_query = env.params.query["search_query"]?
+ if search_query
+ env.redirect "/search?q=#{URI.escape(search_query)}"
+ else
+ env.redirect "/"
+ end
+end
+
get "/search" do |env|
if env.params.query["q"]?
query = env.params.query["q"]