Fix missing HTTPS support for automated withdrawals during development
This commit is contained in:
parent
12f9c4761d
commit
5dd4136c0b
@ -28,7 +28,11 @@ export function lnurlPayDescriptionHash (data) {
|
||||
export async function lnAddrOptions (addr) {
|
||||
await lnAddrSchema().fields.addr.validate(addr)
|
||||
const [name, domain] = addr.split('@')
|
||||
const protocol = domain.includes(':') && process.env.NODE_ENV === 'development' ? 'http' : 'https'
|
||||
let protocol = 'https'
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// support HTTP and HTTPS during development
|
||||
protocol = process.env.PUBLIC_URL.split('://')[0]
|
||||
}
|
||||
const req = await fetch(`${protocol}://${domain}/.well-known/lnurlp/${name}`)
|
||||
const res = await req.json()
|
||||
if (res.status === 'ERROR') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user