MCPcopy Create free account
hub / github.com/simstudioai/sim / isPrivateOrLoopbackIPv6

Function isPrivateOrLoopbackIPv6

apps/sim/lib/api/contracts/tools/sap.ts:91–98  ·  view source on GitHub ↗
(host: string)

Source from the content-addressed store, hash-verified

89}
90
91function isPrivateOrLoopbackIPv6(host: string): boolean {
92 const stripped = host.startsWith('[') && host.endsWith(']') ? host.slice(1, -1) : host
93 const lower = stripped.toLowerCase()
94 if (lower === '::' || lower === '::1') return true
95 if (/^fc[0-9a-f]{2}:/.test(lower) || /^fd[0-9a-f]{2}:/.test(lower)) return true
96 if (lower.startsWith('fe80:')) return true
97 return false
98}
99
100export function checkSapExternalUrlSafety(
101 rawUrl: string,

Callers 1

Calls 1

testMethod · 0.80

Tested by

no test coverage detected