MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / isLoopbackHost

Function isLoopbackHost

projects/runtime-node/src/server.ts:54–60  ·  view source on GitHub ↗
(host: string)

Source from the content-addressed store, hash-verified

52}
53
54function isLoopbackHost(host: string): boolean {
55 if (host === "localhost") return true
56 if (host === "::1") return true
57 if (host.startsWith("127.")) return true
58 const ipVersion = isIP(host)
59 return ipVersion === 6 && host === "::1"
60}
61
62function isAuthorized(request: http.IncomingMessage, options: Required<Pick<RuntimeNodeHttpServerOptions, "allowUnauthenticatedLoopback">> & Pick<RuntimeNodeHttpServerOptions, "host" | "token">): boolean {
63 const token = tokenFromRequest(request)

Callers 1

isAuthorizedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected