fix request url default

This commit is contained in:
Tiago vasconcelos 2021-11-30 14:41:25 +00:00
parent 5b01ee6879
commit f37af0ddf6
4 changed files with 7 additions and 3 deletions

View File

@ -55,7 +55,7 @@ async def lnurl_callback(address_id, amount: int = Query(...)):
if address.wallet_endpoint.endswith("/")
else address.wallet_endpoint
)
print("BASE", base_url)
print("BASE", base_url )
async with httpx.AsyncClient() as client:
try:
call = await client.post(

View File

@ -370,7 +370,7 @@
if (data.wallet_endpoint == '') {
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)
console.log('data', data)

View File

@ -489,6 +489,7 @@
this.getDomains()
this.getAddresses()
}
console.log('{{ request.url.path }}')
// var self = this
//
// // axios is available for making requests

View File

@ -1,4 +1,5 @@
from http import HTTPStatus
from urllib.parse import urlparse
from fastapi import Request
from fastapi.params import Depends
@ -34,7 +35,8 @@ async def display(domain_id, request: Request):
await purge_addresses(domain_id)
wallet = await get_wallet(domain.wallet)
url = urlparse(str(request.url))
return lnaddress_renderer().TemplateResponse(
"lnaddress/display.html",
{
@ -43,5 +45,6 @@ async def display(domain_id, request: Request):
"domain_domain": domain.domain,
"domain_cost": domain.cost,
"domain_wallet_inkey": wallet.inkey,
"root_url": f"{url.scheme}://{url.netloc}"
},
)