mirror of
https://github.com/lnbits/lnbits.git
synced 2025-07-05 04:54:39 +02:00
fix request url default
This commit is contained in:
@ -55,7 +55,7 @@ async def lnurl_callback(address_id, amount: int = Query(...)):
|
|||||||
if address.wallet_endpoint.endswith("/")
|
if address.wallet_endpoint.endswith("/")
|
||||||
else address.wallet_endpoint
|
else address.wallet_endpoint
|
||||||
)
|
)
|
||||||
print("BASE", base_url)
|
print("BASE", base_url )
|
||||||
async with httpx.AsyncClient() as client:
|
async with httpx.AsyncClient() as client:
|
||||||
try:
|
try:
|
||||||
call = await client.post(
|
call = await client.post(
|
||||||
|
@ -370,7 +370,7 @@
|
|||||||
if (data.wallet_endpoint == '') {
|
if (data.wallet_endpoint == '') {
|
||||||
data.wallet_endpoint = null
|
data.wallet_endpoint = null
|
||||||
}
|
}
|
||||||
data.wallet_endpoint = data.wallet_endpoint ?? '{{ request.url_root }}'
|
data.wallet_endpoint = data.wallet_endpoint ?? '{{ root_url }}'
|
||||||
data.duration = parseInt(data.duration)
|
data.duration = parseInt(data.duration)
|
||||||
console.log('data', data)
|
console.log('data', data)
|
||||||
|
|
||||||
|
@ -489,6 +489,7 @@
|
|||||||
this.getDomains()
|
this.getDomains()
|
||||||
this.getAddresses()
|
this.getAddresses()
|
||||||
}
|
}
|
||||||
|
console.log('{{ request.url.path }}')
|
||||||
// var self = this
|
// var self = this
|
||||||
//
|
//
|
||||||
// // axios is available for making requests
|
// // axios is available for making requests
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from http import HTTPStatus
|
from http import HTTPStatus
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from fastapi import Request
|
from fastapi import Request
|
||||||
from fastapi.params import Depends
|
from fastapi.params import Depends
|
||||||
@ -34,6 +35,7 @@ async def display(domain_id, request: Request):
|
|||||||
await purge_addresses(domain_id)
|
await purge_addresses(domain_id)
|
||||||
|
|
||||||
wallet = await get_wallet(domain.wallet)
|
wallet = await get_wallet(domain.wallet)
|
||||||
|
url = urlparse(str(request.url))
|
||||||
|
|
||||||
return lnaddress_renderer().TemplateResponse(
|
return lnaddress_renderer().TemplateResponse(
|
||||||
"lnaddress/display.html",
|
"lnaddress/display.html",
|
||||||
@ -43,5 +45,6 @@ async def display(domain_id, request: Request):
|
|||||||
"domain_domain": domain.domain,
|
"domain_domain": domain.domain,
|
||||||
"domain_cost": domain.cost,
|
"domain_cost": domain.cost,
|
||||||
"domain_wallet_inkey": wallet.inkey,
|
"domain_wallet_inkey": wallet.inkey,
|
||||||
|
"root_url": f"{url.scheme}://{url.netloc}"
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user