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 10:13:47 -05:00 committed by GitHub
parent cb5f8df4c2
commit de6d0b9a1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

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())
}