From 5eb73b41e74944aaf921a19fee6d39059f5a391a Mon Sep 17 00:00:00 2001 From: Adam Veldhousen Date: Sun, 5 Jan 2020 19:39:47 -0600 Subject: [PATCH] redirect empty searches to duck duck go --- internal/http.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/http.go b/internal/http.go index a4a18eb..5d2bb93 100644 --- a/internal/http.go +++ b/internal/http.go @@ -53,6 +53,11 @@ func searchHandler(scs *CommandHandler, shortcutStore *ShortcutStore, logAccess v := req.URL.Query() commandString := v.Get("q") + if commandString == "" { + http.Redirect(res, req, "https://duckduckgo.com", http.StatusFound) + return + } + action, err := scs.Handle(commandString) if err != nil { if logAccess {