basalt / webhooks/src / pinnedFetch
Function: pinnedFetch()
> pinnedFetch(input, init?): Promise<Response>
Defined in: webhooks/src/pinned-fetch.ts:91
A fetch-compatible function over the built-in pinned transport: it connects to init[PINNED_ADDRESS] (the SSRF-validated IP the deliverer resolved) while keeping the original hostname for the Host header and TLS SNI/certificate checks. Use it as the delegate of a custom fetchImpl (instrumentation, logging, metrics) so the wrapper does not lose DNS pinning:
new WebhookDeliverer({
fetchImpl: async (url, init) => { const t = Date.now(); try { return await pinnedFetch(url, init) } finally { metrics.observe(Date.now() - t) } },
fetchImplPinsAddress: true,
})Only what the deliverer sends is supported: a string/URL target, string body, plain-object or Headers headers. The response carries the status only (the body is discarded unread, as the deliverer never reads it). With no pin on init (SSRF guard disabled or allowPrivateHosts), the platform resolver is used.
Parameters
input
string | URL | Request
init?
RequestInit = {}
Returns
Promise<Response>