Skip to content

Commit 701f731

Browse files
committed
Enhance webhook URL validation and logging
- Added validation to check for configured webhook URLs before processing. - Improved logging to warn when no webhook URLs are provided, enhancing error handling. This change ensures that the webhook integration behaves more predictably and provides clearer feedback in the logs.
1 parent 2039b03 commit 701f731

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/links/webhook/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ def run(
3636
# Build headers from configuration
3737
headers = opts.get("headers", {})
3838

39+
# Validate webhook URLs are configured
40+
webhook_urls = opts.get("webhook-urls", [])
41+
if not webhook_urls:
42+
logger.warning(
43+
f"webhook plugin: no webhook-urls configured for vcon {vcon_uuid}, skipping"
44+
)
45+
return vcon_uuid
46+
3947
# Post this to each webhook url
40-
for url in opts["webhook-urls"]:
48+
for url in webhook_urls:
4149
logger.info(
4250
f"webhook plugin: posting vcon {vcon_uuid} to webhook url: {url}"
4351
)

0 commit comments

Comments
 (0)