(url)
| 33 | |
| 34 | // Security: only follow HTTPS URLs (defense-in-depth). |
| 35 | function validateUrl(url) { |
| 36 | if (!url.startsWith('https://')) { |
| 37 | throw new Error(`Refusing non-HTTPS URL: ${url}`); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | function download(url, dest) { |
| 42 | validateUrl(url); |