| 154 | } |
| 155 | |
| 156 | func vscodeProxyURI(app appurl.ApplicationURL, accessURL *url.URL, appHost string) string { |
| 157 | // Proxying by port only works for subdomains. If subdomain support is not |
| 158 | // available, return an empty string. |
| 159 | if appHost == "" { |
| 160 | return "" |
| 161 | } |
| 162 | |
| 163 | // This will handle the ports from the accessURL or appHost. |
| 164 | appHost = appurl.SubdomainAppHost(appHost, accessURL) |
| 165 | // Return the url with a scheme and any wildcards replaced with the app slug. |
| 166 | return accessURL.Scheme + "://" + strings.ReplaceAll(appHost, "*", app.String()) |
| 167 | } |
| 168 | |
| 169 | func dbAgentMetadataToProtoDescription(metadata []database.WorkspaceAgentMetadatum) []*agentproto.WorkspaceAgentMetadata_Description { |
| 170 | ret := make([]*agentproto.WorkspaceAgentMetadata_Description, len(metadata)) |