0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-05-07 16:38:38 +00:00

I need extra eyes.

This commit is contained in:
David Bolack
2026-03-28 18:29:15 -05:00
parent e61556e43b
commit 16bfffe78f
5 changed files with 169 additions and 11 deletions
-9
View File
@@ -80,18 +80,9 @@ export default async function createApp(vite) {
const herokuRegex = /^https:\/\/(?:homebrewery-pr-\d+\.herokuapp\.com|naturalcrit-pr-\d+\.herokuapp\.com)$/; // Matches any Heroku app
console.log( 'IsLocalEnvironment');
console.log(isLocalEnvironment);
console.log('localNetworkRegex');
console.log(localNetworkRegex.test(origin));
console.log('origin');
console.log(origin === 'null');
console.log(origin);
if(!origin || origin === 'null' || allowedOrigins.includes(origin) || herokuRegex.test(origin) || (isLocalEnvironment && localNetworkRegex.test(origin))) {
callback(null, true);
} else {
console.log(origin, 'not allowed');
callback(new Error('Not allowed by CORS, if you think this is an error, please contact us - Skidoosh'));
}
},