From ba67bde99432629e33249253111785e5c8d309bd Mon Sep 17 00:00:00 2001 From: Tyler Date: Sun, 3 May 2020 17:00:54 -0400 Subject: [PATCH] Properly encode values for identifier --- node.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/node.go b/node.go index aebb06f..7bcea8f 100644 --- a/node.go +++ b/node.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/valyala/fastjson" "net/http" + "net/url" "strconv" "strings" @@ -261,9 +262,10 @@ func (node *Node) CreatePlayer(guildID string, sessionID string, event VoiceServ // // See the Lavaplayer Source Code for all valid options. func (node *Node) LoadTracks(query string) (*Tracks, error) { - url := fmt.Sprintf("%s/loadtracks?identifier=%s", node.config.REST, query) + v := url.Values{} + v.Set("identifier", query) - req, err := http.NewRequest(http.MethodGet, url, nil) + req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/loadtracks?%s", node.config.REST, v.Encode()), nil) if err != nil { return nil, err