fix: check_callback_url in dispatch_webhook was not handled (#3503)

This commit is contained in:
dni ⚡ 2025-11-11 11:46:59 +01:00 committed by GitHub
parent e038ceb9be
commit a8c3181852
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -241,6 +241,10 @@ async def dispatch_webhook(payment: Payment):
async with httpx.AsyncClient(headers=headers) as client:
try:
check_callback_url(payment.webhook)
except ValueError as exc:
await mark_webhook_sent(payment.payment_hash, "-1")
logger.warning(f"Invalid webhook URL {payment.webhook}: {exc!s}")
try:
r = await client.post(payment.webhook, json=payment.json(), timeout=40)
r.raise_for_status()
await mark_webhook_sent(payment.payment_hash, str(r.status_code))