mirror of
https://github.com/aljazceru/ditto.git
synced 2026-01-03 13:44:24 +01:00
Merge branch 'lnurl-fix' into 'main'
Fix crash parsing Lightning URL Closes #139 See merge request soapbox-pub/ditto!286
This commit is contained in:
@@ -28,8 +28,12 @@ function getLnurl({ lud06, lud16 }: { lud06?: string; lud16?: string }, limit?:
|
||||
if (lud16) {
|
||||
const [name, host] = lud16.split('@');
|
||||
if (name && host) {
|
||||
const url = new URL(`/.well-known/lnurlp/${name}`, `https://${host}`);
|
||||
return LNURL.encode(url, limit);
|
||||
try {
|
||||
const url = new URL(`/.well-known/lnurlp/${name}`, `https://${host}`);
|
||||
return LNURL.encode(url, limit);
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user