Merge pull request #6 from visualdensity/webhook-skip-ssl-check

Added an option to skip SSL check in webook
This commit is contained in:
Royce Schultz
2024-12-31 16:13:20 +00:00
committed by GitHub
+4 -2
View File
@@ -11,6 +11,7 @@ class Webhook:
"any": (ComfyAnyType("*"), {}),
# "mode": (["always", "on empty queue"], {}), # TODO: Need a way to get queue status from main.py
"webhook_url": ("STRING", {'default': 'http://localhost:5000/'}),
"verify_ssl": ("BOOLEAN", {"default": True}),
"notification_text": ('STRING', {'default': 'Your notification has triggered.'}),
"json_format": ('STRING', {'default': '{"text": "<notification_text>"}'}),
"timeout": ('FLOAT', {'default': 3, 'min': 0, 'max': 60}),
@@ -22,9 +23,10 @@ class Webhook:
RETURN_TYPES = tuple()
CATEGORY = "notifications"
def hook(self, any, webhook_url, notification_text, json_format, timeout):
def hook(self, any, webhook_url, notification_text, json_format, timeout, verify_ssl):
payload = json_format.replace("<notification_text>", notification_text)
payload = json.loads(payload)
res = requests.post(webhook_url, json=payload, timeout=timeout)
res = requests.post(webhook_url, json=payload, timeout=timeout, verify=verify_ssl)
res.raise_for_status()
return (0, )