0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-12 00:12:56 +00:00

update to include all possible local adresses

This commit is contained in:
Víctor Losada Hernández
2025-03-13 22:59:23 +01:00
parent 72c2857237
commit 94bcc8e997

View File

@@ -71,7 +71,8 @@ const corsOptions = {
]; ];
if(isLocalEnvironment) { if(isLocalEnvironment) {
allowedOrigins.push('http://localhost:8000', 'http://localhost:8010', /^http:\/\/192\.168\.\d+\.\d+:\d+$/); const localNetworkRegex = /^http:\/\/(localhost|127\.0\.0\.1|10\.\d+\.\d+\.\d+|192\.168\.\d+\.\d+|172\.(1[6-9]|2\d|3[0-1])\.\d+\.\d+):\d+$/;
allowedOrigins.push(localNetworkRegex);
} }
const herokuRegex = /^https:\/\/(?:homebrewery-pr-\d+\.herokuapp\.com|naturalcrit-pr-\d+\.herokuapp\.com)$/; // Matches any Heroku app const herokuRegex = /^https:\/\/(?:homebrewery-pr-\d+\.herokuapp\.com|naturalcrit-pr-\d+\.herokuapp\.com)$/; // Matches any Heroku app