diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-05-28 21:46:40 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2024-05-28 21:46:40 +0530 |
commit | 3258fa37069fadcf6f265d507c30536e8e9fa091 (patch) | |
tree | 3af7666130c86b3f75ec06420876b7b33b68f533 | |
parent | 7a8b41383eb1ba24c108b2e474524cc4c116de3e (diff) |
escaping the search stringv1.1.2
-rw-r--r-- | search_query.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/search_query.go b/search_query.go index b332437..df72827 100644 --- a/search_query.go +++ b/search_query.go @@ -19,6 +19,7 @@ package meow import ( "fmt" + "net/url" "errors" ) @@ -95,5 +96,5 @@ func (q SearchQuery) build() (string, error) { return "", errors.New("max page number is 100") } - return fmt.Sprintf("%s?f=%d&c=%d_%d&q=%s&p=%d", q.BaseURL, q.Filter, q.Category.Category, q.Category.SubCategory, q.SearchString, q.Page), nil + return fmt.Sprintf("%s?f=%d&c=%d_%d&q=%s&p=%d", q.BaseURL, q.Filter, q.Category.Category, q.Category.SubCategory, url.QueryEscape(q.SearchString), q.Page), nil } |