Skip to content

Commit bd8ec8c

Browse files
committed
fix(site): avoid constructing invalid apps url
1 parent 3014713 commit bd8ec8c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

site/src/utils/apps.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ export const createAppLinkHref = (
2929
}
3030

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

3736
href = url.toString();

site/src/utils/portForward.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ export const portForwardURL = (
1313

1414
const subdomain = `${port}${suffix}--${agentName}--${workspaceName}--${username}`;
1515

16-
const baseUrl = `${location.protocol}//${host}`;
16+
const baseUrl = `${location.protocol}//${host.replace("*", subdomain)}`;
1717
const url = new URL(baseUrl);
18-
url.hostname = host.replace("*", subdomain);
1918

2019
return url.toString();
2120
};

0 commit comments

Comments
 (0)