()
| 57 | } |
| 58 | |
| 59 | function getArch() { |
| 60 | switch (process.arch) { |
| 61 | case 'arm64': return 'arm64'; |
| 62 | case 'x64': return 'amd64'; |
| 63 | default: throw new Error(`Unsupported architecture: ${process.arch}`); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | // Security: only follow HTTPS URLs (defense-in-depth). Parse the URL instead |
| 68 | // of relying on a string prefix so every redirect is checked unambiguously. |