Skip to content

Commit dec57ee

Browse files
committed
fix(chat): support subdomain URLs in chat link rendering
1 parent 1ee0d1a commit dec57ee

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

‎resources/js/pages/Chat/Index.vue‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,10 +1289,22 @@ const isPlatformUrl = (urlString: string): boolean => {
12891289
validHosts.add('hscstack.com');
12901290
validHosts.add('www.hscstack.com');
12911291
1292-
return (
1293-
validHosts.has(parsed.hostname.toLowerCase()) ||
1294-
validHosts.has(parsed.host.toLowerCase())
1295-
);
1292+
const parsedHostname = parsed.hostname.toLowerCase();
1293+
const parsedHost = parsed.host.toLowerCase();
1294+
1295+
for (const host of validHosts) {
1296+
const cleanHost = host.split(':')[0];
1297+
1298+
if (
1299+
parsedHostname === cleanHost ||
1300+
parsedHost === host ||
1301+
parsedHostname.endsWith(`.${cleanHost}`)
1302+
) {
1303+
return true;
1304+
}
1305+
}
1306+
1307+
return false;
12961308
} catch {
12971309
return false;
12981310
}

0 commit comments

Comments
 (0)