diff --git a/internal/coordinator/api/api.go b/internal/coordinator/api/api.go index ed614c7b..07d0f399 100644 --- a/internal/coordinator/api/api.go +++ b/internal/coordinator/api/api.go @@ -692,7 +692,7 @@ func (a *API) proxy(c echo.Context) error { if path != "" && !strings.HasPrefix(path, "/") { path = "/" + path } - req.URL.Path = fmt.Sprintf("/tasks/%s/%s/proxy%s", task.ID, port, path) + req.URL.Path = fmt.Sprintf("/tasks/%s/%s%s", task.ID, port, path) proxy.ServeHTTP(c.Response(), req) return nil } diff --git a/internal/coordinator/api/api_test.go b/internal/coordinator/api/api_test.go index 558b0d60..38478b61 100644 --- a/internal/coordinator/api/api_test.go +++ b/internal/coordinator/api/api_test.go @@ -969,7 +969,7 @@ func Test_proxyTaskRoot(t *testing.T) { ds := inmemory.NewInMemoryDatastore() svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "/tasks/1234/8080/proxy", r.URL.Path) + assert.Equal(t, "/tasks/1234/8080", r.URL.Path) w.WriteHeader(http.StatusOK) })) @@ -1013,7 +1013,7 @@ func Test_proxyTaskSomePath(t *testing.T) { ds := inmemory.NewInMemoryDatastore() svr := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - assert.Equal(t, "/tasks/1234/8080/proxy/some/path", r.URL.Path) + assert.Equal(t, "/tasks/1234/8080/some/path", r.URL.Path) w.WriteHeader(http.StatusOK) }))