From 0671b7aa2b59f5c6235bfa85d6aba54e2ba91353 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sun, 26 Jul 2026 17:58:01 -0400 Subject: [PATCH] refac --- backend/open_webui/utils/webhook.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/utils/webhook.py b/backend/open_webui/utils/webhook.py index d3026ffac6..9430c6ff67 100644 --- a/backend/open_webui/utils/webhook.py +++ b/backend/open_webui/utils/webhook.py @@ -34,8 +34,12 @@ async def post_webhook(name: str, url: str, message: str, event_data: dict, desc # caller-controlled (user notification settings under # ENABLE_USER_WEBHOOKS, automation notification triggers). await asyncio.to_thread(validate_url, url) - payload = {} + except Exception as e: + log.warning('Webhook skipped, URL invalid or not publicly resolvable: %s', e) + return False + try: + payload = {} # Slack and Google Chat Webhooks if 'https://hooks.slack.com' in url or 'https://chat.googleapis.com' in url: payload['text'] = _event_text(message, description, event_data)