Skip to content

fix: reject invalid webhook scheme at startup - #2

Merged
autoantohaki merged 1 commit into
mainfrom
fix/validate-webhook-at-startup
Oct 22, 2026
Merged

autoantohaki merged 1 commit into
mainfrom
fix/validate-webhook-at-startup

Conversation

@autoantohaki

Copy link
Copy Markdown
Member

Requested by mau

Before: a non-HTTPS webhook (without --allow-http) was only rejected when the first alert was delivered. watch kept running and printed "Delivery failed" for every alert, looking healthy until something matched.

After: scan and watch both check the webhook right after loading the config and exit 2 with the HTTPS error before doing any work.

How: the scheme check moved into validate_webhook(), called at startup and still from deliver(). Added a test that runs watch with an http:// webhook; on the old code it hangs in the watch loop.

A non-HTTPS webhook was only rejected when the first alert was delivered. watch then logged 'Delivery failed' for every alert while appearing healthy. Validate the webhook right after loading the config so both commands exit 2 before doing any work.
@autoantohaki
autoantohaki force-pushed the fix/validate-webhook-at-startup branch from 6b735dd to 832691e Compare October 22, 2026 01:29
@autoantohaki
autoantohaki merged commit 5add48e into main Oct 22, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant