From dbacf7e8c12ca7690a2c12d06ffb7202f3c3d0aa Mon Sep 17 00:00:00 2001 From: Ilya Evdokimov Date: Mon, 17 Jun 2024 17:36:15 +0200 Subject: [PATCH] "Failed to connect to https://ws:" crash (#2548) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update base.py fixing bug in normalize_enpoints * Update lnbits/wallets/base.py Co-authored-by: Pavol Rusnak --------- Co-authored-by: dni ⚡ Co-authored-by: Pavol Rusnak --- lnbits/wallets/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lnbits/wallets/base.py b/lnbits/wallets/base.py index f5f7c71da..2abc16cbf 100644 --- a/lnbits/wallets/base.py +++ b/lnbits/wallets/base.py @@ -137,6 +137,8 @@ class Wallet(ABC): def normalize_endpoint(self, endpoint: str, add_proto=True) -> str: endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint if add_proto: + if endpoint.startswith("ws://") or endpoint.startswith("wss://"): + return endpoint endpoint = ( f"https://{endpoint}" if not endpoint.startswith("http") else endpoint )