mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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:
@@ -150,12 +150,14 @@ func (a *ManifestAPI) GetManifest(ctx context.Context, _ *agentproto.GetManifest
|
||||
}
|
||||
|
||||
func vscodeProxyURI(app appurl.ApplicationURL, accessURL *url.URL, appHost string) string {
|
||||
// Proxying by port only works for subdomains. If subdomain support is not
|
||||
// available, return an empty string.
|
||||
if appHost == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
// This will handle the ports from the accessURL or appHost.
|
||||
appHost = appurl.SubdomainAppHost(appHost, accessURL)
|
||||
// If there is no appHost, then we want to use the access url as the proxy uri.
|
||||
if appHost == "" {
|
||||
appHost = accessURL.Host
|
||||
}
|
||||
// Return the url with a scheme and any wildcards replaced with the app slug.
|
||||
return accessURL.Scheme + "://" + strings.ReplaceAll(appHost, "*", app.String())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user