nip05 regex name check.

This commit is contained in:
fiatjaf 2022-12-23 15:04:24 -03:00
parent c08bdac7a7
commit f7e510e1c8
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
1 changed files with 2 additions and 0 deletions

View File

@ -36,6 +36,8 @@ export async function queryProfile(
name = '_'
}
if (!name.match(/^[a-z0-9-_]+$/)) return null
let res = await (
await _fetch(`https://${domain}/.well-known/nostr.json?name=${name}`)
).json()