MCPcopy Create free account
hub / github.com/Kong/insomnia / assertResolvesToPublicHost

Function assertResolvesToPublicHost

packages/insomnia/src/main/lint-process.mjs:80–87  ·  view source on GitHub ↗
(hostname)

Source from the content-addressed store, hash-verified

78
79// Note: This is duplicated in inso's lint-specification.ts. Remember to mirror changes there as well.
80async function assertResolvesToPublicHost(hostname) {
81 const records = await dns.lookup(hostname, { all: true });
82 for (const { address } of records) {
83 if (isPrivateOrLoopbackHost(address)) {
84 throw new Error(`Failed to resolve host. "${hostname}" resolves to a private or loopback address.`);
85 }
86 }
87}
88
89// Note: This is duplicated in inso's lint-specification.ts. Remember to mirror changes there as well.
90const safeHttpResolver = {

Callers 1

resolveFunction · 0.70

Calls 1

isPrivateOrLoopbackHostFunction · 0.70

Tested by

no test coverage detected