fix: escape query on search
This commit is contained in:
parent
b97a09da37
commit
7a5a8392c7
@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
)
|
||||
|
||||
type response struct {
|
||||
@ -35,7 +36,7 @@ type renderVars struct {
|
||||
|
||||
func searchHandler(w http.ResponseWriter, r *http.Request) {
|
||||
query := r.URL.Query().Get("q")
|
||||
url := fmt.Sprintf(`https://genius.com/api/search/multi?q=%s`, query)
|
||||
url := fmt.Sprintf(`https://genius.com/api/search/multi?q=%s`, url.QueryEscape(query))
|
||||
|
||||
res, err := sendRequest(url)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user