follow redirect for lnurls (#1832)

closes #976
This commit is contained in:
dni ⚡ 2023-07-25 11:06:37 +02:00 committed by GitHub
parent a81a2b5a08
commit 427f155c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,