(resolvedIP: string)
| 401 | * user-controlled hostnames via non-HTTP protocols (SMTP, SSH, IMAP, etc.). |
| 402 | */ |
| 403 | export 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 |
no outgoing calls
no test coverage detected