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

Function createPinnedLookup

apps/sim/lib/core/security/input-validation.server.ts:403–414  ·  view source on GitHub ↗
(resolvedIP: string)

Source from the content-addressed store, hash-verified

401 * user-controlled hostnames via non-HTTP protocols (SMTP, SSH, IMAP, etc.).
402 */
403export function createPinnedLookup(resolvedIP: string): LookupFunction {
404 const isIPv6 = resolvedIP.includes(':')
405 const family = isIPv6 ? 6 : 4
406
407 return (_hostname, options, callback) => {
408 if (options.all) {
409 callback(null, [{ address: resolvedIP, family }])
410 } else {
411 callback(null, resolvedIP, family)
412 }
413 }
414}
415
416/**
417 * Builds a standard `fetch`-compatible function that pins every outbound

Callers 3

createMongoDBConnectionFunction · 0.90
createPinnedFetchFunction · 0.85
secureFetchWithPinnedIPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected