diff --git a/coderd/workspaceapps.go b/coderd/workspaceapps.go index c82ed680a3258..77286655b3b5a 100644 --- a/coderd/workspaceapps.go +++ b/coderd/workspaceapps.go @@ -38,12 +38,12 @@ func (api *API) workspaceAppsProxyPath(rw http.ResponseWriter, r *http.Request) chiPath = "/" + chiPath } - appName, port := httpapi.AppNameOrPort(chi.URLParam(r, "workspaceapp")) api.proxyWorkspaceApplication(proxyApplication{ - Workspace: workspace, - Agent: agent, - AppName: appName, - Port: port, + Workspace: workspace, + Agent: agent, + // We do not support port proxying for paths. + AppName: chi.URLParam(r, "workspaceapp"), + Port: 0, Path: chiPath, DashboardOnError: true, }, rw, r) diff --git a/coderd/workspaceapps_test.go b/coderd/workspaceapps_test.go index 2f601b629be9e..11a75d4a967f3 100644 --- a/coderd/workspaceapps_test.go +++ b/coderd/workspaceapps_test.go @@ -129,7 +129,7 @@ func setupProxyTest(t *testing.T) (*codersdk.Client, uuid.UUID, codersdk.Workspa func TestWorkspaceAppsProxyPath(t *testing.T) { t.Parallel() - client, orgID, workspace, port := setupProxyTest(t) + client, orgID, workspace, _ := setupProxyTest(t) t.Run("LoginWithoutAuth", func(t *testing.T) { t.Parallel() @@ -209,22 +209,6 @@ func TestWorkspaceAppsProxyPath(t *testing.T) { require.Equal(t, http.StatusOK, resp.StatusCode) }) - t.Run("ProxiesPort", func(t *testing.T) { - t.Parallel() - - ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) - defer cancel() - - path := fmt.Sprintf("/@me/%s/apps/%d/?%s", workspace.Name, port, proxyTestAppQuery) - resp, err := client.Request(ctx, http.MethodGet, path, nil) - require.NoError(t, err) - defer resp.Body.Close() - body, err := io.ReadAll(resp.Body) - require.NoError(t, err) - require.Equal(t, proxyTestAppBody, string(body)) - require.Equal(t, http.StatusOK, resp.StatusCode) - }) - t.Run("ProxyError", func(t *testing.T) { t.Parallel()