()
| 47 | } |
| 48 | |
| 49 | function getArch() { |
| 50 | switch (process.arch) { |
| 51 | case 'arm64': return 'arm64'; |
| 52 | case 'x64': return 'amd64'; |
| 53 | default: throw new Error(`Unsupported architecture: ${process.arch}`); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // Security: only follow HTTPS URLs (defense-in-depth). Parse the URL instead |
| 58 | // of relying on a string prefix so every redirect is checked unambiguously. |