Skip to content

Commit f0132b5

Browse files
authored
fix: fix workspace proxy command app link href (#11423)
* fix: workspace proxy command app link href
1 parent 46b90ce commit f0132b5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

site/src/utils/apps.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("create app link", () => {
5959
},
6060
);
6161
expect(href).toBe(
62-
"/path-base/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la",
62+
"/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la",
6363
);
6464
});
6565

site/src/utils/apps.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ export const createAppLinkHref = (
2020
agent.name
2121
}/apps/${encodeURIComponent(appSlug)}/`;
2222
if (app.command) {
23-
href = `${preferredPathBase}/@${username}/${workspace.name}.${
23+
// Terminal links are relative. The terminal page knows how
24+
// to select the correct workspace proxy for the websocket
25+
// connection.
26+
href = `/@${username}/${workspace.name}.${
2427
agent.name
2528
}/terminal?command=${encodeURIComponent(app.command)}`;
2629
}

0 commit comments

Comments
 (0)