fix: only specify vscode proxy uri if app subdomains enabled (#9891)

Otherwise this generates an invalid URI that breaks code-server!
This commit is contained in:
Kyle Carberry
2023-09-27 15:13:47 +00:00
committed by GitHub
parent cb5f8df4c2
commit de6d0b9a1a
+3 -1
View File
@@ -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())
}