Skip to content

[Bug] CLI: pause, resume, delete, and open actions are broken when targeting a remote server #456

@SuperCoolPencil

Description

@SuperCoolPencil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions