Skip to content

Commit 1360bfe

Browse files
authored
chore: fix false positives in CodeQL for TS (coder#17139)
Fixes some false positives flagged by CodeQL
1 parent eded0ed commit 1360bfe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

site/src/utils/apps.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const createAppLinkHref = (
2929
}
3030

3131
if (appsHost && app.subdomain && app.subdomain_name) {
32-
const baseUrl = `${protocol}//${appsHost.replace("*", app.subdomain_name)}`;
32+
const baseUrl = `${protocol}//${appsHost.replace(/\*/g, app.subdomain_name)}`;
3333
const url = new URL(baseUrl);
3434
url.pathname = "/";
3535

site/src/utils/portForward.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const portForwardURL = (
1515

1616
const subdomain = `${port}${suffix}--${agentName}--${workspaceName}--${username}`;
1717

18-
const baseUrl = `${location.protocol}//${host.replace("*", subdomain)}`;
18+
const baseUrl = `${location.protocol}//${host.replace(/\*/g, subdomain)}`;
1919
const url = new URL(baseUrl);
2020
if (pathname) {
2121
url.pathname = pathname;

0 commit comments

Comments
 (0)