mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-05 04:54:39 +02:00
"Failed to connect to https://ws:" crash (#2548)
* Update base.py fixing bug in normalize_enpoints * Update lnbits/wallets/base.py Co-authored-by: Pavol Rusnak <pavol@rusnak.io> --------- Co-authored-by: dni ⚡ <office@dnilabs.com> Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
This commit is contained in:
@ -137,6 +137,8 @@ class Wallet(ABC):
|
|||||||
def normalize_endpoint(self, endpoint: str, add_proto=True) -> str:
|
def normalize_endpoint(self, endpoint: str, add_proto=True) -> str:
|
||||||
endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint
|
endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint
|
||||||
if add_proto:
|
if add_proto:
|
||||||
|
if endpoint.startswith("ws://") or endpoint.startswith("wss://"):
|
||||||
|
return endpoint
|
||||||
endpoint = (
|
endpoint = (
|
||||||
f"https://{endpoint}" if not endpoint.startswith("http") else endpoint
|
f"https://{endpoint}" if not endpoint.startswith("http") else endpoint
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user