| 253 | // previous `[webBaseUrl]` exactly and an operator who repeats it in the env var |
| 254 | // does not get a duplicate. |
| 255 | const resolveTrustedOrigins = (webBaseUrl: string): readonly string[] => { |
| 256 | const additional = (process.env.EXECUTOR_TRUSTED_ORIGINS ?? "") |
| 257 | .split(",") |
| 258 | .map((value) => value.trim()) |
| 259 | .filter((value) => value.length > 0) |
| 260 | .map(normalizeTrustedOrigin); |
| 261 | return [...new Set([webBaseUrl, ...additional])]; |
| 262 | }; |
| 263 | |
| 264 | // The org slug doubles as a URL segment (`/<slug>/policies`), so an |
| 265 | // operator-set value must fit the shared grammar and avoid reserved root |