Properly encode values for identifier

This commit is contained in:
Tyler 2020-05-03 17:00:54 -04:00
parent fbab76d269
commit ba67bde994
1 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"github.com/valyala/fastjson" "github.com/valyala/fastjson"
"net/http" "net/http"
"net/url"
"strconv" "strconv"
"strings" "strings"
@ -261,9 +262,10 @@ func (node *Node) CreatePlayer(guildID string, sessionID string, event VoiceServ
// //
// See the Lavaplayer Source Code for all valid options. // See the Lavaplayer Source Code for all valid options.
func (node *Node) LoadTracks(query string) (*Tracks, error) { 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 { if err != nil {
return nil, err return nil, err