From 427f155c76bfb7b99b4ce665f23b729aa6264716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Tue, 25 Jul 2023 11:06:37 +0200 Subject: [PATCH] follow redirect for lnurls (#1832) closes #976 --- lnbits/core/views/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index c6bea824..11d47da9 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -541,8 +541,9 @@ async def api_lnurlscan(code: str, wallet: WalletTypeInfo = Depends(get_key_type assert lnurlauth_key.verifying_key params.update(pubkey=lnurlauth_key.verifying_key.to_string("compressed").hex()) else: - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(follow_redirects=True) as client: r = await client.get(url, timeout=5) + r.raise_for_status() if r.is_error: raise HTTPException( status_code=HTTPStatus.SERVICE_UNAVAILABLE,