Skip to content

SITE_RELATIVE_PATH_PATTERN

const SITE_RELATIVE_PATH_PATTERN: RegExp

Defined in: packages/core/src/fields/url/inputSchema.ts:13

Matches a site-relative path: a string starting with exactly one / (/brand/logo.svg). Rejects protocol-relative paths (//host/...) and backslash-led paths (/\evil.com, //evil.com), both of which browsers resolve against the current scheme/host and therefore behave like an absolute URL to an arbitrary host.