Skip to content

Commit 6c560f3

Browse files
Fixed security issues
1 parent af5750e commit 6c560f3

File tree

1 file changed

+5
-2
lines changed
  • packages/contentstack-bootstrap/src/bootstrap

1 file changed

+5
-2
lines changed

packages/contentstack-bootstrap/src/bootstrap/utils.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { cliux, pathValidator, sanitizePath } from '@contentstack/cli-utilities'
44
import { continueBootstrapCommand } from '../bootstrap/interactive';
55
import { AppConfig } from '../config';
66
import messageHandler from '../messages';
7+
import { regions } from '@contentstack/cli-config/lib/utils/region-handler';
78

89
interface EnvironmentVariables {
910
api_key: string;
@@ -187,8 +188,10 @@ const envFileHandler = async (
187188
const cdnHost = region?.cda?.substring('8');
188189
const appHost = region?.uiHost?.substring(8);
189190
const isUSRegion = regionName === 'us' || regionName === 'na';
190-
const isPredefinedRegion = region?.cda &&
191-
(region.cda.includes('contentstack.io') || region.cda.includes('contentstack.com'));
191+
192+
const isPredefinedRegion = region?.name && Object.keys(regions).some(
193+
key => key.toLowerCase() === region.name.toLowerCase()
194+
);
192195

193196
if (regionName !== 'eu' && !isUSRegion) {
194197
customHost = region?.cma?.substring(8);

0 commit comments

Comments
 (0)