MCPcopy Index your code
hub / github.com/simstudioai/sim / getHostnameFromUrl

Function getHostnameFromUrl

apps/sim/lib/core/security/csp.ts:19–26  ·  view source on GitHub ↗
(url: string | undefined)

Source from the content-addressed store, hash-verified

17}
18
19function getHostnameFromUrl(url: string | undefined): string[] {
20 if (!url) return []
21 try {
22 return [`https://${new URL(url).hostname}`]
23 } catch {
24 return []
25 }
26}
27
28export interface CSPDirectives {
29 'default-src'?: string[]

Callers 2

csp.tsFile · 0.85
generateRuntimeCSPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected