MCPcopy
hub / github.com/simstudioai/sim / isEmbedPath

Function isEmbedPath

apps/sim/proxy.ts:29–37  ·  view source on GitHub ↗

True for /api/chat/[identifier] and any deeper subroute.

(pathname: string)

Source from the content-addressed store, hash-verified

27
28/** True for /api/chat/[identifier] and any deeper subroute. */
29function isEmbedPath(pathname: string): boolean {
30 const segments = pathname.split('/')
31 if (segments.length < 4) return false
32 if (segments[1] !== 'api') return false
33 if (segments[2] !== 'chat') return false
34 const identifier = segments[3]
35 if (!identifier || EMBED_RESERVED_SEGMENTS.has(identifier)) return false
36 return true
37}
38
39interface CorsRule {
40 match: (pathname: string) => boolean

Callers 1

proxy.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected