nip05 supports uppercase

nip05 says `NIP-05 assumes the <local-part> part will be restricted to the characters a-z0-9-_., case insensitive`

So a lot of people is starting the names with uppercase. See here:

`https://nostr-check.com/.well-known/nostr.json`

So I think we should change the regex to accept lowercase or uppercase.

Another way to do it would be to do a `.toLowerCase` at the beginning, but then we would need to do this search ignoring the case:

```
if (!res?.names?.[name])
```

So maybe for now this is enough?
This commit is contained in:
Luis Miguel 2023-01-31 14:09:24 +01:00 committed by fiatjaf
parent 312b6fd035
commit 61f397463d
1 changed files with 1 additions and 1 deletions

View File

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