mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: Add browser-only connections to Enterprise (#4135)
* feat: Add browser-only connections to Enterprise Fixes #4131. * Fix formatting
This commit is contained in:
+3
-2
@@ -489,8 +489,9 @@ func New(options *Options) *API {
|
||||
|
||||
type API struct {
|
||||
*Options
|
||||
Auditor atomic.Pointer[audit.Auditor]
|
||||
HTTPAuth *HTTPAuthorizer
|
||||
Auditor atomic.Pointer[audit.Auditor]
|
||||
WorkspaceClientCoordinateOverride atomic.Pointer[func(rw http.ResponseWriter) bool]
|
||||
HTTPAuth *HTTPAuthorizer
|
||||
|
||||
// APIHandler serves "/api/v2"
|
||||
APIHandler chi.Router
|
||||
|
||||
@@ -403,6 +403,11 @@ func (api *API) workspaceAgentClientCoordinate(rw http.ResponseWriter, r *http.R
|
||||
httpapi.ResourceNotFound(rw)
|
||||
return
|
||||
}
|
||||
// This is used by Enterprise code to control the functionality of this route.
|
||||
override := api.WorkspaceClientCoordinateOverride.Load()
|
||||
if override != nil && (*override)(rw) {
|
||||
return
|
||||
}
|
||||
|
||||
api.websocketWaitMutex.Lock()
|
||||
api.websocketWaitGroup.Add(1)
|
||||
|
||||
Reference in New Issue
Block a user