mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-19 01:43:42 +01: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:
parent
b6d99b09cf
commit
dbacf7e8c1
@ -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
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user