1
0

lnurl: fix lightning address regex

This commit is contained in:
Sander van Grieken
2023-05-12 13:53:51 +02:00
parent 89225a9f41
commit 17a89efd3c

View File

@@ -153,6 +153,6 @@ def lightning_address_to_url(address: str) -> Optional[str]:
"""Converts an email-type lightning address to a decoded lnurl.
see https://github.com/fiatjaf/lnurl-rfc/blob/luds/16.md
"""
if re.match(r"[^@]+@[^@]+\.[^@]+", address):
if re.match(r"^[^@]+@[^.@]+(\.[^.@]+)+$", address):
username, domain = address.split("@")
return f"https://{domain}/.well-known/lnurlp/{username}"