Skip to content

Commit c4fa9f4

Browse files
authored
fix: handle webhooks without hook_type status (#948)
1 parent 336b5ad commit c4fa9f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/api/v1/routes/webhooks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ def handle_webhook(
7979
):
8080
webhook_payload = webhook_result.payload
8181
webhook_payload.channel = webhook["channel"]["S"]
82-
hook_type = webhook["hook_type"]["S"]
82+
hook_type = webhook.get("hook_type", {}).get(
83+
"S", "alert"
84+
) # Default to "alert" if hook_type is missing
8385
if hook_type == "alert":
8486
webhook_payload = append_incident_buttons(webhook_payload, webhook_id)
8587

0 commit comments

Comments
 (0)