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

Function assertResolvesToPublicHost

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

Source from the content-addressed store, hash-verified

63
64// Note: This is duplicated in inso's lint-specification.ts. Remember to mirror changes there as well.
65async function assertResolvesToPublicHost(hostname) {
66 const records = await dns.lookup(hostname, { all: true });
67 for (const { address } of records) {
68 if (isPrivateOrLoopbackHost(address)) {
69 throw new Error(`Failed to resolve host. "${hostname}" resolves to a private or loopback address.`);
70 }
71 }
72}
73
74// Note: This is duplicated in inso's lint-specification.ts. Remember to mirror changes there as well.
75const safeHttpResolver = {

Callers 1

resolveFunction · 0.70

Calls 1

isPrivateOrLoopbackHostFunction · 0.70

Tested by

no test coverage detected