Skip to content

Commit 24244a9

Browse files
committed
fix: add Region property conditionally to endpoint object in getContentstackEndpoint
1 parent a7a8caa commit 24244a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/endpoints.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ export async function getContentstackEndpoint(region: string = 'us', service: st
4646

4747
try {
4848
const endpoint = service ? endpointsData[cloud][region][service] : endpointsData[cloud][region];
49-
endpoint['Region'] = normalizedRegion;
49+
50+
// Only add Region property if endpoint is an object (not a string)
51+
if (typeof endpoint === 'object' && endpoint !== null) {
52+
endpoint['Region'] = normalizedRegion;
53+
}
5054

5155
return omitHttps ? stripHttps(endpoint) : endpoint;
5256
} catch (error) {

0 commit comments

Comments
 (0)