The CLI commands that use ExecuteAPIAction (such as pause, resume, rm, open) are currently sending requests to the remote server using path parameters (e.g., POST /pause/uuid), but the HTTP API server implementation in cmd/http_api.go uses http.ServeMux and expects the ID as a query parameter (e.g., POST /pause?id=uuid).
Specifically:
ExecuteAPIAction in cmd/utils.go uses fmt.Sprintf("%s/%s", endpoint, id).
registerHTTPRoutes in cmd/http_api.go registers /pause and uses withRequiredID which calls r.URL.Query().Get("id").
This results in a 404 Not Found when attempting to pause/resume/delete downloads via the CLI on a remote Surge daemon.
The CLI commands that use
ExecuteAPIAction(such aspause,resume,rm,open) are currently sending requests to the remote server using path parameters (e.g.,POST /pause/uuid), but the HTTP API server implementation incmd/http_api.gouseshttp.ServeMuxand expects the ID as a query parameter (e.g.,POST /pause?id=uuid).Specifically:
ExecuteAPIActionincmd/utils.gousesfmt.Sprintf("%s/%s", endpoint, id).registerHTTPRoutesincmd/http_api.goregisters/pauseand useswithRequiredIDwhich callsr.URL.Query().Get("id").This results in a 404 Not Found when attempting to pause/resume/delete downloads via the CLI on a remote Surge daemon.