Skip to content

Commit

Permalink
Merge pull request #2346 from shubhamkmr04/shubham/fix-onion-domain-a…
Browse files Browse the repository at this point in the history
…ddresses

handleAnything: Fix lnaddress with onion domain
  • Loading branch information
kaloudis authored Aug 26, 2024
2 parents b6ed77c + e091f83 commit dbc70c8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utils/handleAnything.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,16 @@ const handleAnything = async (
}

const [username, domain] = value.split('@');
const url = `https://${domain}/.well-known/lnurlp/${username.toLowerCase()}`;
let url;
if (domain.includes('.onion')) {
url = `http://${domain}/.well-known/lnurlp/${username.toLowerCase()}`;
} else {
url = `https://${domain}/.well-known/lnurlp/${username.toLowerCase()}`;
}
const error = localeString(
'utils.handleAnything.lightningAddressError'
);

// handle Tor LN addresses
if (settingsStore.enableTor && domain.includes('.onion')) {
await doTorRequest(url, RequestMethod.GET)
Expand Down

0 comments on commit dbc70c8

Please sign in to comment.