From 2fdf3d24e3443da9888b7fc4ddd33d4072edcdcb Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Wed, 2 Jan 2019 20:14:31 -0600 Subject: [PATCH] Redirect to home page on empty search --- src/invidious.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/invidious.cr b/src/invidious.cr index 1d85a0bfa..ba47fab4f 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -588,6 +588,10 @@ get "/search" do |env| query ||= env.params.query["q"]? query ||= "" + if query.empty? + next env.redirect "/" + end + page = env.params.query["page"]?.try &.to_i? page ||= 1