(env: NodeJS.ProcessEnv = process.env)
| 58 | * caller can express domain-suffix wildcards (`.example.com`). |
| 59 | */ |
| 60 | export function parseAllowedHosts(env: NodeJS.ProcessEnv = process.env): string[] { |
| 61 | const raw = env['KIMI_CODE_ALLOWED_HOSTS']; |
| 62 | if (raw === undefined) { |
| 63 | return []; |
| 64 | } |
| 65 | return raw |
| 66 | .split(',') |
| 67 | .map((entry) => entry.trim()) |
| 68 | .filter((entry) => entry.length > 0); |
| 69 | } |
| 70 | |
| 71 | /** True when `KIMI_CODE_DISABLE_HOST_CHECK=1` (test/controlled env only). */ |
| 72 | export function isHostCheckDisabled(env: NodeJS.ProcessEnv = process.env): boolean { |
no outgoing calls
no test coverage detected