Fix missing method in lnurlp error (#2139)

This commit is contained in:
ekzyis 2025-04-26 21:04:39 +02:00 committed by GitHub
parent 97317d4c0c
commit 236f930a17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,11 +39,12 @@ export async function lnAddrOptions (addr, { signal } = {}) {
const unexpectedErrorMessage = 'Lightning address validation failed. Make sure you entered the correct address.'
let body
const method = 'GET'
const url = `${protocol}://${domain}/.well-known/lnurlp/${name}`
try {
const res = await fetch(url, { signal })
assertResponseOk(res)
assertContentTypeJson(res)
const res = await fetch(url, { method, signal })
assertResponseOk(res, { method })
assertContentTypeJson(res, { method })
body = await res.json()
} catch (err) {
console.log('Error fetching lnurlp:', err)