Skip to content

Commit b7e4189

Browse files
committed
rename
1 parent da1bfcf commit b7e4189

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

coderd/tailnet.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,16 @@ func (s *ServerTailnet) ReverseProxy(targetURL, dashboardURL *url.URL, agentID u
369369
Scheme: dashboardURL.Scheme,
370370
}
371371
if app.IsPort() {
372-
if app.Protocol() == "https" {
372+
if app.PortProtocol() == "https" {
373373
app.ChangePortProtocol("http")
374374
} else {
375375
app.ChangePortProtocol("https")
376376
}
377377

378378
switchURL.Host = fmt.Sprintf("%s%s", app.String(), strings.TrimPrefix(wildcardHostname, "*"))
379379
switchLink = switchURL.String()
380-
switchTarget = app.Protocol()
381-
additional += fmt.Sprintf("This error seems to be due to an app protocol mismatch, try switching to %s.", strings.ToUpper(app.Protocol()))
380+
switchTarget = app.PortProtocol()
381+
additional += fmt.Sprintf("This error seems to be due to an app protocol mismatch, try switching to %s.", strings.ToUpper(app.PortProtocol()))
382382
}
383383
}
384384

coderd/workspaceapps/appurl/appurl.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (a ApplicationURL) IsPort() bool {
107107
return true
108108
}
109109

110-
func (a ApplicationURL) Protocol() string {
110+
func (a ApplicationURL) PortProtocol() string {
111111
if strings.HasSuffix(a.AppSlugOrPort, "s") {
112112
trimmed := strings.TrimSuffix(a.AppSlugOrPort, "s")
113113
_, err := strconv.ParseInt(trimmed, 10, 64)
@@ -121,7 +121,7 @@ func (a ApplicationURL) Protocol() string {
121121

122122
func (a *ApplicationURL) ChangePortProtocol(target string) {
123123
if target == "http" {
124-
if a.Protocol() == "http" {
124+
if a.PortProtocol() == "http" {
125125
return
126126
}
127127
trimmed := strings.TrimSuffix(a.AppSlugOrPort, "s")
@@ -132,7 +132,7 @@ func (a *ApplicationURL) ChangePortProtocol(target string) {
132132
}
133133

134134
if target == "https" {
135-
if a.Protocol() == "https" {
135+
if a.PortProtocol() == "https" {
136136
return
137137
}
138138
_, err := strconv.ParseInt(a.AppSlugOrPort, 10, 64)

coderd/workspaceapps/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ func (s *Server) proxyWorkspaceApp(rw http.ResponseWriter, r *http.Request, appT
546546
r.URL.Path = path
547547
appURL.RawQuery = ""
548548
if app.IsPort() {
549-
appURL.Scheme = app.Protocol()
549+
appURL.Scheme = app.PortProtocol()
550550
}
551551

552552
proxy := s.AgentProvider.ReverseProxy(appURL, s.DashboardURL, appToken.AgentID, app, s.Hostname)

0 commit comments

Comments
 (0)