From 6e6ce093f0eae521b3d697b40184213a94edeb06 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Mon, 5 Oct 2020 08:45:57 -0300 Subject: [PATCH] guard against lndrest URLs without a leading http... --- lnbits/wallets/lndrest.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lnbits/wallets/lndrest.py b/lnbits/wallets/lndrest.py index a2bea09..be4e4e5 100644 --- a/lnbits/wallets/lndrest.py +++ b/lnbits/wallets/lndrest.py @@ -13,7 +13,10 @@ class LndRestWallet(Wallet): def __init__(self): endpoint = getenv("LND_REST_ENDPOINT") - self.endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint + endpoint = endpoint[:-1] if endpoint.endswith("/") else endpoint + endpoint = "https://" + endpoint if not endpoint.startswith("http") else endpoint + self.endpoint = endpoint + self.auth_admin = { "Grpc-Metadata-macaroon": getenv("LND_ADMIN_MACAROON") or getenv("LND_REST_ADMIN_MACAROON"), }