Skip to content

Commit

Permalink
Fix: remove /proxy from the path
Browse files Browse the repository at this point in the history
  • Loading branch information
runabol committed Jul 16, 2024
1 parent 884e76a commit 51d1a59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/coordinator/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions internal/coordinator/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}))

Expand Down Expand Up @@ -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)
}))

Expand Down

0 comments on commit 51d1a59

Please sign in to comment.