From 4b1cf12eba24cdab797692d8a0a16c0fe48d9cf0 Mon Sep 17 00:00:00 2001 From: Mohammed Mohsin <59914433+mdmohsin7@users.noreply.github.com> Date: Tue, 6 Feb 2024 15:45:25 +0530 Subject: [PATCH] fix: trim `/` from lambdaServer url --- packages/lnlambda/lib/src/lnlambda_base.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/lnlambda/lib/src/lnlambda_base.dart b/packages/lnlambda/lib/src/lnlambda_base.dart index 5378546..ff65423 100644 --- a/packages/lnlambda/lib/src/lnlambda_base.dart +++ b/packages/lnlambda/lib/src/lnlambda_base.dart @@ -46,13 +46,16 @@ class LNLambdaClient implements LightningClient { throw Exception( "A rune for the call need to be specified or in the params as `steal_rune` or in the client constructor as default rune"); } + var lnLambdaServer = lambdaServer.endsWith('/') + ? lambdaServer.substring(0, lambdaServer.length - 1) + : lambdaServer; var request = LNLambdaRequest( nodeID: nodeID, host: host, rune: callRune, method: method, params: params); - var response = await http.post(Uri.parse("$lambdaServer/lnsocket"), + var response = await http.post(Uri.parse("$lnLambdaServer/lnsocket"), headers: { 'Content-Type': 'application/json; charset=UTF-8', },