Skip to content

Commit 577b17e

Browse files
committed
temp disable direct on debug
1 parent 1c9d785 commit 577b17e

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

components/ws-proxy/pkg/proxy/routes.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ func installWorkspaceRoutes(r *mux.Router, config *RouteHandlerConfig, ip Worksp
9494
})
9595
routes.HandleSupervisorFrontendRoute(faviconRouter.NewRoute())
9696

97-
routes.HandleDirectSupervisorRoute(enableCompression(r).PathPrefix("/_supervisor/frontend").MatcherFunc(func(r *http.Request, rm *mux.RouteMatch) bool {
98-
return rm.Vars[debugWorkspaceIdentifier] == "true"
99-
}), false)
97+
// routes.HandleDirectSupervisorRoute(enableCompression(r).PathPrefix("/_supervisor/frontend").MatcherFunc(func(r *http.Request, rm *mux.RouteMatch) bool {
98+
// return rm.Vars[debugWorkspaceIdentifier] == "true"
99+
// }), false)
100100
routes.HandleSupervisorFrontendRoute(enableCompression(r).PathPrefix("/_supervisor/frontend"))
101101

102102
routes.HandleDirectSupervisorRoute(r.PathPrefix("/_supervisor/v1/status/supervisor"), false)
@@ -115,12 +115,12 @@ func installWorkspaceRoutes(r *mux.Router, config *RouteHandlerConfig, ip Worksp
115115
h.ServeHTTP(resp, req)
116116
})
117117
})
118-
err := routes.HandleDebugRoot(rootRouter.MatcherFunc(func(r *http.Request, rm *mux.RouteMatch) bool {
119-
return rm.Vars[debugWorkspaceIdentifier] == "true"
120-
}))
121-
if err != nil {
122-
return err
123-
}
118+
// err := routes.HandleDebugRoot(rootRouter.MatcherFunc(func(r *http.Request, rm *mux.RouteMatch) bool {
119+
// return rm.Vars[debugWorkspaceIdentifier] == "true"
120+
// }))
121+
// if err != nil {
122+
// return err
123+
// }
124124
routes.HandleRoot(rootRouter.NewRoute())
125125
return nil
126126
}
@@ -277,7 +277,7 @@ func (ir *ideRoutes) HandleRoot(route *mux.Route) {
277277
r.Use(ir.Config.CorsHandler)
278278
r.Use(ir.workspaceMustExistHandler)
279279

280-
directIDEPass := ir.Config.WorkspaceAuthHandler(
280+
workspaceIDEPass := ir.Config.WorkspaceAuthHandler(
281281
proxyPass(ir.Config, ir.InfoProvider, workspacePodResolver),
282282
)
283283
// always hit the blobserver to ensure that blob is downloaded
@@ -342,7 +342,7 @@ func (ir *ideRoutes) HandleRoot(route *mux.Route) {
342342
return image
343343
},
344344
}
345-
}, withHTTPErrorHandler(directIDEPass), withUseTargetHost()))
345+
}, withHTTPErrorHandler(workspaceIDEPass), withUseTargetHost()))
346346
}
347347

348348
const imagePathSeparator = "/__files__"

components/ws-proxy/pkg/proxy/routes_test.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -617,23 +617,23 @@ func TestRoutes(t *testing.T) {
617617
Body: "debug workspace hit: /\n",
618618
},
619619
},
620-
{
621-
Desc: "debug supervisor frontend /main.js",
622-
Config: &config,
623-
Request: modifyRequest(httptest.NewRequest("GET", debugWorkspaceURL+"_supervisor/frontend/main.js", nil),
624-
addHostHeader,
625-
),
626-
Targets: &Targets{DebugSupervisor: &Target{Status: http.StatusOK}},
627-
Expectation: Expectation{
628-
Status: http.StatusOK,
629-
Header: http.Header{
630-
"Content-Length": {"52"},
631-
"Content-Type": {"text/plain; charset=utf-8"},
632-
"Vary": {"Accept-Encoding"},
633-
},
634-
Body: "supervisor debug hit: /_supervisor/frontend/main.js\n",
635-
},
636-
},
620+
// {
621+
// Desc: "debug supervisor frontend /main.js",
622+
// Config: &config,
623+
// Request: modifyRequest(httptest.NewRequest("GET", debugWorkspaceURL+"_supervisor/frontend/main.js", nil),
624+
// addHostHeader,
625+
// ),
626+
// Targets: &Targets{DebugSupervisor: &Target{Status: http.StatusOK}},
627+
// Expectation: Expectation{
628+
// Status: http.StatusOK,
629+
// Header: http.Header{
630+
// "Content-Length": {"52"},
631+
// "Content-Type": {"text/plain; charset=utf-8"},
632+
// "Vary": {"Accept-Encoding"},
633+
// },
634+
// Body: "supervisor debug hit: /_supervisor/frontend/main.js\n",
635+
// },
636+
// },
637637
}
638638

639639
log.Init("ws-proxy-test", "", false, true)

0 commit comments

Comments
 (0)