MCPcopy Create free account
hub / github.com/chhoumann/quickadd / isLoopbackClient

Function isLoopbackClient

src/interactive/interactivePromptServer.ts:181–189  ·  view source on GitHub ↗
(headers: {
	origin?: string;
	referer?: string;
	host?: string;
})

Source from the content-addressed store, hash-verified

179 * Origin/Referer, and a Host of 127.0.0.1/localhost (DNS-rebinding guard).
180 */
181export function isLoopbackClient(headers: {
182 origin?: string;
183 referer?: string;
184 host?: string;
185}): boolean {
186 if (headers.origin || headers.referer) return false;
187 const hostname = (headers.host ?? "").split(":")[0];
188 return hostname === "127.0.0.1" || hostname === "localhost";
189}
190
191function nodeRequire<T>(mod: string): T | null {
192 try {

Callers 2

originAllowedMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected