fix: lnurl should follow redirect (#2167)
`r.raise_for_status` raises an proper exception now
This commit is contained in:
parent
f9c9c52d75
commit
8352223704
1 changed files with 2 additions and 1 deletions
|
|
@ -405,7 +405,7 @@ async def api_payments_pay_lnurl(
|
|||
domain = urlparse(data.callback).netloc
|
||||
|
||||
headers = {"User-Agent": settings.user_agent}
|
||||
async with httpx.AsyncClient(headers=headers) as client:
|
||||
async with httpx.AsyncClient(headers=headers, follow_redirects=True) as client:
|
||||
try:
|
||||
r = await client.get(
|
||||
data.callback,
|
||||
|
|
@ -414,6 +414,7 @@ async def api_payments_pay_lnurl(
|
|||
)
|
||||
if r.is_error:
|
||||
raise httpx.ConnectError("LNURL callback connection error")
|
||||
r.raise_for_status()
|
||||
except (httpx.ConnectError, httpx.RequestError):
|
||||
raise HTTPException(
|
||||
status_code=HTTPStatus.BAD_REQUEST,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue