(host: string)
| 57 | const TAILSCALE_IP_COMMAND_TIMEOUT_MS = 1_000; |
| 58 | |
| 59 | function isLoopbackHost(host: string): boolean { |
| 60 | const normalized = host.trim().toLowerCase(); |
| 61 | |
| 62 | // IPv4 loopback range (RFC 1122): 127.0.0.0/8 |
| 63 | if (normalized.startsWith("127.")) { |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | return normalized === "localhost" || normalized === "::1"; |
| 68 | } |
| 69 | |
| 70 | function formatHostForUrl(host: string): string { |
| 71 | const trimmed = host.trim(); |
no outgoing calls
no test coverage detected