(hostname)
| 78 | |
| 79 | // Note: This is duplicated in inso's lint-specification.ts. Remember to mirror changes there as well. |
| 80 | async 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. |
| 90 | const safeHttpResolver = { |
no test coverage detected