From f0132b543d18994add4226a615d56da46684da64 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Fri, 5 Jan 2024 11:27:06 -0500 Subject: [PATCH] fix: fix workspace proxy command app link href (#11423) * fix: workspace proxy command app link href --- site/src/utils/apps.test.ts | 2 +- site/src/utils/apps.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/site/src/utils/apps.test.ts b/site/src/utils/apps.test.ts index 9e188efb2a..9223668f65 100644 --- a/site/src/utils/apps.test.ts +++ b/site/src/utils/apps.test.ts @@ -59,7 +59,7 @@ describe("create app link", () => { }, ); expect(href).toBe( - "/path-base/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la", + "/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la", ); }); diff --git a/site/src/utils/apps.ts b/site/src/utils/apps.ts index 6021f2ffeb..b412984172 100644 --- a/site/src/utils/apps.ts +++ b/site/src/utils/apps.ts @@ -20,7 +20,10 @@ export const createAppLinkHref = ( agent.name }/apps/${encodeURIComponent(appSlug)}/`; if (app.command) { - href = `${preferredPathBase}/@${username}/${workspace.name}.${ + // Terminal links are relative. The terminal page knows how + // to select the correct workspace proxy for the websocket + // connection. + href = `/@${username}/${workspace.name}.${ agent.name }/terminal?command=${encodeURIComponent(app.command)}`; }