MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isPreapprovedHost

Function isPreapprovedHost

src/tools/WebFetchTool/preapproved.ts:154–166  ·  view source on GitHub ↗
(hostname: string, pathname: string)

Source from the content-addressed store, hash-verified

152})()
153
154export function isPreapprovedHost(hostname: string, pathname: string): boolean {
155 if (HOSTNAME_ONLY.has(hostname)) return true
156 const prefixes = PATH_PREFIXES.get(hostname)
157 if (prefixes) {
158 for (const p of prefixes) {
159 // Enforce path segment boundaries: "/anthropics" must not match
160 // "/anthropics-evil/malware". Only exact match or a "/" after the
161 // prefix is allowed.
162 if (pathname === p || pathname.startsWith(p + '/')) return true
163 }
164 }
165 return false
166}
167

Callers 2

checkPermissionsFunction · 0.85
isPreapprovedUrlFunction · 0.85

Calls 2

getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected