MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / isLoopbackBind

Function isLoopbackBind

scripts/bind-host.mjs:19–28  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

17const SAFE_HTTP_METHODS = new Set(["GET", "HEAD", "OPTIONS"]);
18
19export function isLoopbackBind(host) {
20 if (host == null || host === "") return false;
21 const normalized = String(host)
22 .trim()
23 .replace(/^\[|\]$/g, "")
24 .toLowerCase();
25 return (
26 STATIC_LOOPBACK_HOSTS.has(normalized) || IPV4_LOOPBACK_RE.test(normalized)
27 );
28}
29
30/**
31 * Parse a `Host` header authority without permitting URL userinfo (`@`),

Callers 6

buildConfigFunction · 0.90
mountMarsWebBridgeFunction · 0.90
bind-host.test.tsFile · 0.90
isLoopbackHostnameFunction · 0.85
isForeignLoopbackRequestFunction · 0.85
applySessionKeyPolicyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected