diff --git a/evaluator/evaluator.go b/evaluator/evaluator.go index c4c8e56..6dc5b56 100644 --- a/evaluator/evaluator.go +++ b/evaluator/evaluator.go @@ -1,12 +1,13 @@ package main import ( - "net/http" - "log" - "strings" "encoding/json" "io/ioutil" + "log" + "net/http" + "net/url" "regexp" + "strings" ) var bangs = loadBangs() @@ -45,7 +46,7 @@ func loadBangs() (bangs map[string]string) { } func buildSearchURL(template string, query string) (searchUrl string) { - return strings.Replace(template, "%s", query, 1) + return strings.Replace(template, "%s", url.QueryEscape(query), 1) } func parseBang(searchQuery string) (bang string, query string) {