fix: check_callback_url in dispatch_webhook was not handled (#3503)
This commit is contained in:
parent
e038ceb9be
commit
a8c3181852
1 changed files with 4 additions and 0 deletions
|
|
@ -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))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue