From d1cf550a859d1ea96abb778a56db5b6c1c2a832d Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Wed, 27 Sep 2023 09:56:36 -0500 Subject: [PATCH] fix: only specify vscode proxy uri if app subdomains enabled Otherwise this generates an invalid URI that breaks code-server! --- coderd/workspaceagents.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index c506c83e20666..52fa7cf8d4ab3 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -216,7 +216,9 @@ func (api *API) workspaceAgentManifest(rw http.ResponseWriter, r *http.Request) Username: owner.Username, } vscodeProxyURI := api.AccessURL.Scheme + "://" + strings.ReplaceAll(api.AppHostname, "*", appHost.String()) - + if api.AppHostname == "" { + vscodeProxyURI += api.AccessURL.Hostname() + } if api.AccessURL.Port() != "" { vscodeProxyURI += fmt.Sprintf(":%s", api.AccessURL.Port()) }