MCPcopy Index your code
hub / github.com/simstudioai/sim / pinned

Function pinned

apps/sim/lib/core/security/input-validation.server.ts:437–445  ·  view source on GitHub ↗
(input: RequestInfo | URL, init?: RequestInit)

Source from the content-addressed store, hash-verified

435 const dispatcher = new Agent({ connect: { lookup: createPinnedLookup(resolvedIP) } })
436
437 const pinned = async (input: RequestInfo | URL, init?: RequestInit): Promise<Response> => {
438 // double-cast-allowed: DOM RequestInfo/URL and undici fetch input types differ but are structurally compatible at runtime (Node's global fetch IS undici)
439 const undiciInput = input as unknown as Parameters<typeof undiciFetch>[0]
440 // double-cast-allowed: DOM RequestInit and undici RequestInit are structurally compatible at runtime but the TS types differ
441 const undiciInit: UndiciRequestInit = { ...(init as unknown as UndiciRequestInit), dispatcher }
442 const response = await undiciFetch(undiciInput, undiciInit)
443 // double-cast-allowed: undici Response and DOM Response are structurally compatible at runtime
444 return response as unknown as Response
445 }
446
447 return pinned
448}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected