fix: allow all gohorsejobs.com subdomains in CORS for backoffice

This commit is contained in:
Tiago Yamamoto 2026-02-23 11:51:31 -06:00
parent fd2fa328ad
commit 01a6cab984

View file

@ -51,7 +51,10 @@ async function bootstrap() {
...envOrigins,
].filter(Boolean);
if (!origin || allowedOrigins.includes(origin)) {
// Allow all *.gohorsejobs.com subdomains (http and https)
const gohorsePattern = /^https?:\/\/([a-z0-9-]+\.)*gohorsejobs\.com$/;
if (!origin || allowedOrigins.includes(origin) || gohorsePattern.test(origin)) {
callback(null, true);
} else {
callback(new Error('Not allowed by CORS'), false);