fix: rstip url globally

This commit is contained in:
lucasheld 2023-08-12 16:39:44 +02:00
parent 2611b344f1
commit 3543f09a5f

View file

@ -421,7 +421,7 @@ class UptimeKumaApi(object):
ssl_verify: bool = True, ssl_verify: bool = True,
wait_events: float = 0.2 wait_events: float = 0.2
) -> None: ) -> None:
self.url = url self.url = url.rstrip("/")
self.timeout = timeout self.timeout = timeout
self.headers = headers self.headers = headers
self.wait_events = wait_events self.wait_events = wait_events
@ -616,9 +616,8 @@ class UptimeKumaApi(object):
:raises UptimeKumaException: When connection to server failed. :raises UptimeKumaException: When connection to server failed.
""" """
url = self.url.rstrip("/")
try: try:
self.sio.connect(f'{url}/socket.io/', wait_timeout=self.timeout, headers=self.headers) self.sio.connect(f'{self.url}/socket.io/', wait_timeout=self.timeout, headers=self.headers)
except: except:
raise UptimeKumaException("unable to connect") raise UptimeKumaException("unable to connect")