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