(env: NodeJS.ProcessEnv = process.env)
| 37 | * an explicit origin (PLAN §3.4). |
| 38 | */ |
| 39 | export function parseCorsOrigins(env: NodeJS.ProcessEnv = process.env): string[] { |
| 40 | const raw = env['KIMI_CODE_CORS_ORIGINS']; |
| 41 | if (raw === undefined) { |
| 42 | return []; |
| 43 | } |
| 44 | return raw |
| 45 | .split(',') |
| 46 | .map((entry) => entry.trim()) |
| 47 | .filter((entry) => entry.length > 0); |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Return the `host` (host[:port], default port dropped) of an `Origin` value, |
no outgoing calls
no test coverage detected