NIP-57: build lnurl in more secure way

This commit is contained in:
Alex Gleason 2024-01-15 16:47:57 -06:00 committed by fiatjaf_
parent 7b79d6a899
commit 677b679c2c
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ export async function getZapEndpoint(metadata: Event): Promise<null | string> {
lnurl = utf8Decoder.decode(data)
} else if (lud16) {
let [name, domain] = lud16.split('@')
lnurl = `https://${domain}/.well-known/lnurlp/${name}`
lnurl = new URL(`/.well-known/lnurlp/${name}`, `https://${domain}`).toString()
} else {
return null
}