mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-09 00:28:51 +00:00
support _ names in nip05.
This commit is contained in:
6
nip05.js
6
nip05.js
@@ -15,6 +15,12 @@ export async function searchDomain(domain, query = '') {
|
|||||||
export async function queryName(fullname) {
|
export async function queryName(fullname) {
|
||||||
try {
|
try {
|
||||||
let [name, domain] = fullname.split('@')
|
let [name, domain] = fullname.split('@')
|
||||||
|
|
||||||
|
if (!domain) {
|
||||||
|
domain = name
|
||||||
|
name = '_'
|
||||||
|
}
|
||||||
|
|
||||||
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}`)
|
||||||
).json()
|
).json()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nostr-tools",
|
"name": "nostr-tools",
|
||||||
"version": "0.20.0",
|
"version": "0.20.1",
|
||||||
"description": "Tools for making a Nostr client.",
|
"description": "Tools for making a Nostr client.",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Reference in New Issue
Block a user