From 714fd3dae3b141aa0ec878e23bc542ce371299fb Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Sun, 29 Jul 2018 21:05:40 -0500 Subject: [PATCH] Add 'results' route redirect --- src/invidious.cr | 9 +++++++++ 1 file changed, 9 insertions(+) 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"]