(url)
| 97 | } |
| 98 | |
| 99 | function assertAllowedHost(url) { |
| 100 | const { hostname } = new URL(url); |
| 101 | if (!ALLOWED_HOSTS.has(hostname)) { |
| 102 | throw new Error(`Download host not allowed: ${hostname}`); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | // Resolve the mirror URL chain and admit each host. Called from install() so |
| 107 | // derived hosts only become trusted when actually needed. |
no outgoing calls
no test coverage detected