do not redirect to / if bang is not known
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon Bruder 2019-05-27 13:33:19 +00:00
parent 3543dd5df8
commit 051bd354a4
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F

View file

@ -66,9 +66,11 @@ func parseBang(searchQuery string) (bang string, query string) {
func evaluateBang(searchQuery string, searchEngine string) (query string, engine string) {
bang, query := parseBang(searchQuery)
if bang == "" {
return query, searchEngine
engine = bangs[bang]
if (bang == "" || engine == ""){
return searchQuery, searchEngine
} else {
return query, bangs[bang]
return query, engine
}
}