Skip to content

fix: use url-parse for url construction #15670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Nov 27, 2024
Prev Previous commit
Next Next commit
update var name
  • Loading branch information
sreya committed Nov 27, 2024
commit 233af4bf6d37622eeb7721288ce430384b0e20ad
8 changes: 4 additions & 4 deletions site/src/utils/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ export const createAppLinkHref = (

// The backend redirects if the trailing slash isn't included, so we add it
// here to avoid extra roundtrips.
let path = `${preferredPathBase}/@${username}/${workspace.name}.${
let href = `${preferredPathBase}/@${username}/${workspace.name}.${
agent.name
}/apps/${encodeURIComponent(appSlug)}/`;
if (app.command) {
// Terminal links are relative. The terminal page knows how
// to select the correct workspace proxy for the websocket
// connection.
path = `/@${username}/${workspace.name}.${
href = `/@${username}/${workspace.name}.${
agent.name
}/terminal?command=${encodeURIComponent(app.command)}`;
}
Expand All @@ -35,7 +35,7 @@ export const createAppLinkHref = (
url.set('hostname', appsHost.replace('*', app.subdomain_name));
url.set('pathname', '/');

path = url.toString();
href = url.toString();
}
return path;
return href;
};