Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/hooks/useRoomActivity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ const USER_MAP_CHANGE_MSG = 'user_map';
* @returns {string} - The websocket host
*/
const getWebsocketHost = (providerHost: string): string => {
if (providerHost === MESHERY_CLOUD_PROD) {
// Compare against hostnames without protocol since parsedUrl.host
// strips the protocol (e.g. "cloud.layer5.io" not "https://cloud.layer5.io")
const prodHost = new URL(MESHERY_CLOUD_PROD).host;
if (providerHost === prodHost) {
return MESHERY_CLOUD_WS_PROD;
} else if (providerHost === MESHERY_CLOUD_STAGING) {
return MESHERY_CLOUD_WS_STAGING;
Comment on lines +66 to 72
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

providerHost is passed as parsedUrl.host, which includes any explicit port (e.g. cloud.layer5.io:443). new URL(MESHERY_CLOUD_PROD).host will be cloud.layer5.io (no port), so this comparison will fail if the provider URL includes a port. Consider normalizing both sides using .hostname (or otherwise stripping any port / lowercasing) and doing the same normalization for staging for consistency.

Copilot uses AI. Check for mistakes.
Expand Down
Loading