Skip to content

Commit 3618b09

Browse files
authored
fix: Return deprecation error when using WebRTC endpoint (#4130)
Fixes #4126.
1 parent 2ca7214 commit 3618b09

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

coderd/coderd.go

+8
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ func New(options *Options) *API {
430430
r.Get("/pty", api.workspaceAgentPTY)
431431
r.Get("/connection", api.workspaceAgentConnection)
432432
r.Get("/coordinate", api.workspaceAgentClientCoordinate)
433+
// TODO: This can be removed in October. It allows for a friendly
434+
// error message when transitioning from WebRTC to Tailscale. See:
435+
// https://github.com/coder/coder/issues/4126
436+
r.Get("/dial", func(w http.ResponseWriter, r *http.Request) {
437+
httpapi.Write(w, http.StatusGone, codersdk.Response{
438+
Message: "Your Coder CLI is out of date, and requires v0.8.15+ to connect!",
439+
})
440+
})
433441
})
434442
})
435443
r.Route("/workspaceresources/{workspaceresource}", func(r chi.Router) {

coderd/coderdtest/authorize.go

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ func AGPLRoutes(a *AuthTester) (map[string]string, map[string]RouteCheck) {
4444
"POST:/api/v2/users/login": {NoAuthorize: true},
4545
"GET:/api/v2/users/authmethods": {NoAuthorize: true},
4646
"POST:/api/v2/csp/reports": {NoAuthorize: true},
47+
// This is a dummy endpoint for compatibility.
48+
"GET:/api/v2/workspaceagents/{workspaceagent}/dial": {NoAuthorize: true},
4749

4850
// Has it's own auth
4951
"GET:/api/v2/users/oauth2/github/callback": {NoAuthorize: true},

0 commit comments

Comments
 (0)