MCPcopy Create free account
hub / github.com/Noumena-Network/code / stripWww

Function stripWww

src/tools/WebFetchTool/utils.ts:243–243  ·  view source on GitHub ↗
(hostname: string)

Source from the content-addressed store, hash-verified

241 // 2. Removing www. is allowed: www.example.com -> example.com
242 // 3. Same host (with or without www.) is allowed: paths can change
243 const stripWww = (hostname: string) => hostname.replace(/^www\./, '')
244 const originalHostWithoutWww = stripWww(parsedOriginal.hostname)
245 const redirectHostWithoutWww = stripWww(parsedRedirect.hostname)
246 return originalHostWithoutWww === redirectHostWithoutWww

Callers 1

isPermittedRedirectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected