From 3543f09a5fbacb67069639b117680e0e258a9bef Mon Sep 17 00:00:00 2001 From: lucasheld Date: Sat, 12 Aug 2023 16:39:44 +0200 Subject: [PATCH] fix: rstip url globally --- uptime_kuma_api/api.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/uptime_kuma_api/api.py b/uptime_kuma_api/api.py index f3c0941..424a0a3 100644 --- a/uptime_kuma_api/api.py +++ b/uptime_kuma_api/api.py @@ -421,7 +421,7 @@ class UptimeKumaApi(object): ssl_verify: bool = True, wait_events: float = 0.2 ) -> None: - self.url = url + self.url = url.rstrip("/") self.timeout = timeout self.headers = headers self.wait_events = wait_events @@ -616,9 +616,8 @@ class UptimeKumaApi(object): :raises UptimeKumaException: When connection to server failed. """ - url = self.url.rstrip("/") 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: raise UptimeKumaException("unable to connect")