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

Function isSameOrigin

apps/sim/lib/core/utils/validation.ts:13–19  ·  view source on GitHub ↗
(url: string, base: string = getBaseUrl())

Source from the content-addressed store, hash-verified

11 * @returns True if the URL is same-origin, false otherwise (secure default)
12 */
13export function isSameOrigin(url: string, base: string = getBaseUrl()): boolean {
14 try {
15 return new URL(url).origin === new URL(base).origin
16 } catch {
17 return false
18 }
19}
20
21/**
22 * Validates a name by removing any characters that could cause issues

Callers 5

isSelfOriginUrlFunction · 0.90
user.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
gitlab.tsFile · 0.90

Calls 1

getBaseUrlFunction · 0.90

Tested by

no test coverage detected