fix: check_callback_url in dispatch_webhook was not handled (#3503)
This commit is contained in:
@@ -241,6 +241,10 @@ async def dispatch_webhook(payment: Payment):
|
|||||||
async with httpx.AsyncClient(headers=headers) as client:
|
async with httpx.AsyncClient(headers=headers) as client:
|
||||||
try:
|
try:
|
||||||
check_callback_url(payment.webhook)
|
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 = await client.post(payment.webhook, json=payment.json(), timeout=40)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
await mark_webhook_sent(payment.payment_hash, str(r.status_code))
|
await mark_webhook_sent(payment.payment_hash, str(r.status_code))
|
||||||
|
|||||||
Reference in New Issue
Block a user