MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isLoopbackHost

Function isLoopbackHost

apps/vis/server/src/config.ts:32–40  ·  view source on GitHub ↗
(host: string)

Source from the content-addressed store, hash-verified

30}
31
32export function isLoopbackHost(host: string): boolean {
33 const normalized = host.trim().toLowerCase().replaceAll('[', '').replaceAll(']', '');
34 return (
35 normalized === 'localhost' ||
36 normalized === '::1' ||
37 normalized === '0:0:0:0:0:0:0:1' ||
38 normalized.startsWith('127.')
39 );
40}
41
42/** Format a host for embedding in a URL authority. Bare IPv6 literals (which
43 * contain ':') must be bracketed, e.g. `::1` → `[::1]`, otherwise

Callers 1

resolveVisAuthTokenFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected