Skip to content

Commit ef2c357

Browse files
Fixed region issue
1 parent 040b54f commit ef2c357

File tree

1 file changed

+8
-4
lines changed
  • packages/contentstack-bootstrap/src/bootstrap

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,14 @@ const envFileHandler = async (
190190
if (regionName !== 'eu' && !isUSRegion) {
191191
customHost = region?.cma?.substring(8);
192192
}
193-
let graphqlHost = "graphql.contentstack.com";
194-
if(regionName != 'na'){
195-
graphqlHost = `${regionName}-.graphql.contentstack.com`;
196-
}
193+
const getGraphqlHost = (name?: string): string => {
194+
const r = name?.toLowerCase();
195+
if (!r || r === 'na' || r === 'aws-na') {
196+
return 'graphql.contentstack.com';
197+
}
198+
return `${r}-graphql.contentstack.com`;
199+
};
200+
const graphqlHost = getGraphqlHost(regionName);
197201

198202

199203
// Construct image hostname based on the actual host being used

0 commit comments

Comments
 (0)