Skip to content

Commit

Permalink
fix: invalid path for devices commands
Browse files Browse the repository at this point in the history
  • Loading branch information
danya committed Nov 6, 2024
1 parent d8016f5 commit 5ab985f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/app/enaptercli/cmd_devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io"
"net/url"

"github.com/urfave/cli/v2"
)
Expand Down Expand Up @@ -38,7 +39,11 @@ func (c *cmdDevices) Flags() []cli.Flag {
}

func (c *cmdDevices) doHTTPRequest(ctx context.Context, p doHTTPRequestParams) error {
p.Path = "/devices/" + c.deviceID
path, err := url.JoinPath("/devices", c.deviceID, p.Path)
if err != nil {
return fmt.Errorf("join path: %w", err)
}
p.Path = path
return c.cmdBase.doHTTPRequest(ctx, p)
}

Expand Down

0 comments on commit 5ab985f

Please sign in to comment.