fix: flaky RandomSuffix test + CORS allow-list on public gateway #7
Reference in New Issue
Block a user
Delete Branch "feature/cors-and-flaky-test"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two unrelated fixes that surfaced during the post-CI-reorg shakedown.
pkg/util: harden TestRandomSuffixGeneratorThe previous test compared each of 100 samples against the previous one — birthday collisions made it flake ~1 % per run, and we caught it in go-unit #51. Replaced with a distinctness-floor check over 200 samples (~10 000-element space, expected ~198 unique, floor at 150). Still catches a stuck or narrow-range generator without depending on randomness behaving today.
gateway: CORS allow-list on the public REST surfaceThe dev UI on
https://www.galaxy.lancross-origins tohttps://api.galaxy.lanand the browser was blocking responses. Added aGATEWAY_PUBLIC_HTTP_CORS_ALLOWED_ORIGINSenv-driven allow-list with a small custom middleware. Mounts before route-classification and anti-abuse so OPTIONS preflights never charge against rate-limit buckets. Defaults to empty (closed), andtools/dev-deploy/docker-compose.ymlopts the dev gateway intohttps://www.galaxy.lan.Local-dev posture is unchanged — Vite proxies through the same origin, no CORS needed.