Skip to content

Commit 54b2445

Browse files
authored
Merge pull request #1397 from layer5io/fix/release-workflow-dispatch
fix: compare providerHost against stripped protocol hostname in getWebsocketHost
2 parents 36455fc + c35f6f8 commit 54b2445

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hooks/useRoomActivity.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ const USER_MAP_CHANGE_MSG = 'user_map';
6363
* @returns {string} - The websocket host
6464
*/
6565
const getWebsocketHost = (providerHost: string): string => {
66-
if (providerHost === MESHERY_CLOUD_PROD) {
66+
// Compare against hostnames without protocol since parsedUrl.host
67+
// strips the protocol (e.g. "cloud.layer5.io" not "https://cloud.layer5.io")
68+
const prodHost = new URL(MESHERY_CLOUD_PROD).host;
69+
if (providerHost === prodHost) {
6770
return MESHERY_CLOUD_WS_PROD;
6871
} else if (providerHost === MESHERY_CLOUD_STAGING) {
6972
return MESHERY_CLOUD_WS_STAGING;

0 commit comments

Comments
 (0)