diff --git a/src/common/cluster-store.ts b/src/common/cluster-store.ts index c68692edd3..4000684d16 100644 --- a/src/common/cluster-store.ts +++ b/src/common/cluster-store.ts @@ -357,11 +357,8 @@ export const clusterStore = ClusterStore.getInstance(); export function getClusterIdFromHost(host: string): ClusterId | undefined { // e.g host == "%clusterId.localhost:45345" const subDomains = host.split(":")[0].split("."); - const lastTwoParts = subDomains.slice(-2); - lastTwoParts.pop(); // remove last entry (namely "localhost") - - return lastTwoParts[0]; // ClusterId or undefined + return subDomains.slice(-2, -1)[0]; // ClusterId or undefined } export function getClusterFrameUrl(clusterId: ClusterId) {