fix: code-server path based forwarding, defer to code-server (#11759)

Do not attempt to construct a path based port forward url.
Always defer to code server, as it has it's own proxy method.
This commit is contained in:
Steven Masley
2024-01-23 11:36:44 -06:00
committed by GitHub
parent 77a4792ecd
commit 081fbef097
3 changed files with 13 additions and 8 deletions
+5 -1
View File
@@ -681,7 +681,11 @@ func (s *Server) CreateCommand(ctx context.Context, script string, env []string)
// This adds the ports dialog to code-server that enables
// proxying a port dynamically.
cmd.Env = append(cmd.Env, fmt.Sprintf("VSCODE_PROXY_URI=%s", manifest.VSCodePortProxyURI))
// If this is empty string, do not set anything. Code-server auto defaults
// using its basepath to construct a path based port proxy.
if manifest.VSCodePortProxyURI != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("VSCODE_PROXY_URI=%s", manifest.VSCodePortProxyURI))
}
// Hide Coder message on code-server's "Getting Started" page
cmd.Env = append(cmd.Env, "CS_DISABLE_GETTING_STARTED_OVERRIDE=true")