fix: allow all gohorsejobs.com subdomains in CORS for backoffice
This commit is contained in:
parent
fd2fa328ad
commit
01a6cab984
1 changed files with 4 additions and 1 deletions
|
|
@ -51,7 +51,10 @@ async function bootstrap() {
|
||||||
...envOrigins,
|
...envOrigins,
|
||||||
].filter(Boolean);
|
].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);
|
callback(null, true);
|
||||||
} else {
|
} else {
|
||||||
callback(new Error('Not allowed by CORS'), false);
|
callback(new Error('Not allowed by CORS'), false);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue