redirect empty searches to duck duck go

pull/9/head
Adam Veldhousen 2020-01-05 19:39:47 -06:00
parent 7133ac2f98
commit 5eb73b41e7
Signed by: adam
GPG Key ID: 6DB29003C6DD1E4B
1 changed files with 5 additions and 0 deletions

View File

@ -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 {