Remove trailing slash in lighning wallet

This commit is contained in:
Vic 2024-08-25 14:47:36 -04:00 committed by Overtorment
parent dbf2a8e5d8
commit e2153d6ca5

View file

@ -36,7 +36,7 @@ export class LightningCustodianWallet extends LegacyWallet {
* @param URI
*/
setBaseURI(URI: string | undefined) {
this.baseURI = URI;
this.baseURI = URI?.endsWith("/") ? URI.slice(0, -1) : URI;
}
getBaseURI() {
@ -579,7 +579,7 @@ export class LightningCustodianWallet extends LegacyWallet {
}
static async isValidNodeAddress(address: string) {
const response = await fetch(address + '/getinfo', {
const response = await fetch((address?.endsWith("/") ? address.slice(0, -1) : address) + '/getinfo', {
method: 'GET',
headers: {
'Access-Control-Allow-Origin': '*',