refactor(web): make the shared origin list read-only (#200)

ALLOWED_ORIGINS was private to ws.ts; it is now exported by origin.ts and
read by the routes too. Typed `readonly string[]`, so that no module can add
an origin to it by mistake. Same two values, same behaviour.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-11-15 00:34:08 -05:00
commit 337a8e9240

View file

@ -8,7 +8,7 @@
//
// No import here: server.ts bundles ws.ts, and this module with it, apart
// from the Next routes (web/Dockerfile, esbuild).
export const ALLOWED_ORIGINS = [
export const ALLOWED_ORIGINS: readonly string[] = [
'https://liste.lacompagniemaximus.com',
'http://localhost:3000',
];