(host: string | undefined)
| 104 | } |
| 105 | |
| 106 | export function formatHostErrorMessage(host: string | undefined): string { |
| 107 | const normalizedHost = host === undefined || host.length === 0 ? undefined : stripPort(host); |
| 108 | const hostLabel = normalizedHost ?? '<missing>'; |
| 109 | const hostArg = normalizedHost ?? '<host>'; |
| 110 | return `Invalid Host header: ${hostLabel}; allow this host with KIMI_CODE_ALLOWED_HOSTS=${hostArg} or 'kimi server run --allowed-host ${hostArg}'.`; |
| 111 | } |
| 112 | |
| 113 | /** |
| 114 | * Decide whether a `Host` value is allowed under the given options. |
no test coverage detected