Skip to content

Commit

Permalink
Fix and complete the secure connection implementation (Cog-Creators#116)
Browse files Browse the repository at this point in the history
* Fix the partial implementation of a secure connection.

* https 1

* address review

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
  • Loading branch information
Drapersniper and Jackenmen committed Mar 21, 2022
1 parent 8bf483f commit 9fa6732
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions lavalink/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,19 +277,15 @@ class RESTClient:
Client class used to access the REST endpoints on a Lavalink node.
"""

def __init__(self, node):
self.node = node
self.secured = node.secured
def __init__(self):
self.secured = self.node.secured
self._session = self.node.session
if self.secured:
protocol = "https"
else:
protocol = "http"
self._uri = f"{protocol}://{node.host}:{node.port}/loadtracks?identifier="
self._headers = {"Authorization": node.password}

self.state = player.state

self._uri = f"{protocol}://{self.node.host}:{self.node.port}/loadtracks?identifier="
self._headers = {"Authorization": self.node.password}
self._warned = False

def __check_node_ready(self):
Expand Down

0 comments on commit 9fa6732

Please sign in to comment.