Compare commits

..

No commits in common. "master" and "v1.0.2" have entirely different histories.

1 changed files with 7 additions and 11 deletions

18
node.go
View File

@ -77,11 +77,10 @@ type FrameStats struct {
func (node *Node) open(ctx context.Context) error {
header := http.Header{}
header.Set("User-Agent", gavalinkUserAgent())
header.Set("Authorization", node.config.Password)
header.Set("Num-Shards", strconv.Itoa(node.manager.shards))
header.Set("User-Id", node.manager.userID)
header.Set("Client-Name", "Gavalink")
header.Set("User-Agent", gavalinkUserAgent())
if node.manager.capabilities != nil {
v := make([]string, 0)
@ -105,19 +104,16 @@ func (node *Node) open(ctx context.Context) error {
return err
}
// TODO: This isn't officially required, so we ignore it for now if it's empty.
vstr := resp.Header.Get("Lavalink-Major-Version")
if vstr != "" {
v, err := strconv.Atoi(vstr)
v, err := strconv.Atoi(vstr)
if err != nil {
return err
}
if err != nil {
return err
}
if v < 3 {
return errInvalidVersion
}
if v < 3 {
return errInvalidVersion
}
node.wsConn = ws