| 332 | // previous `[webBaseUrl]` exactly and an operator who repeats it in the env var |
| 333 | // does not get a duplicate. |
| 334 | const resolveTrustedOrigins = (webBaseUrl: string): readonly string[] => { |
| 335 | const additional = (process.env.EXECUTOR_TRUSTED_ORIGINS ?? "") |
| 336 | .split(",") |
| 337 | .map((value) => value.trim()) |
| 338 | .filter((value) => value.length > 0) |
| 339 | .map(normalizeTrustedOrigin); |
| 340 | return [...new Set([webBaseUrl, ...additional])]; |
| 341 | }; |
| 342 | |
| 343 | // The org slug doubles as a URL segment (`/<slug>/policies`), so an |
| 344 | // operator-set value must fit the shared grammar and avoid reserved root |