cron: separate webhook POST delivery from announce (#17901)

* cron: split webhook delivery from announce mode

* cron: validate webhook delivery target

* cron: remove legacy webhook fallback config

* fix: finalize cron webhook delivery prep (#17901) (thanks @advaitpaliwal)

---------

Co-authored-by: Tyler Yust <TYTYYUST@YAHOO.COM>
This commit is contained in:
Advait Paliwal
2026-02-16 02:36:00 -08:00
committed by GitHub
parent d841c9b26b
commit bc67af6ad8
33 changed files with 698 additions and 236 deletions

22
src/cron/webhook-url.ts Normal file
View File

@@ -0,0 +1,22 @@
function isAllowedWebhookProtocol(protocol: string) {
return protocol === "http:" || protocol === "https:";
}
export function normalizeHttpWebhookUrl(value: unknown): string | null {
if (typeof value !== "string") {
return null;
}
const trimmed = value.trim();
if (!trimmed) {
return null;
}
try {
const parsed = new URL(trimmed);
if (!isAllowedWebhookProtocol(parsed.protocol)) {
return null;
}
return trimmed;
} catch {
return null;
}
}