Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Fix exec resize - it was prepending URL to the path which broke the call #190

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions dockerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,14 @@ func (client *DockerClient) ExecStart(id string, config *ExecConfig) error {
}

func (client *DockerClient) ExecResize(id string, width, height int) error {
return client.resize("exec", id, width, height)
}

func (client *DockerClient) ContainerResize(id string, width, height int) error {
return client.resize("containers", id, width, height)
}

func (client *DockerClient) resize(mode, id string, width, height int) error {
v := url.Values{}

w := strconv.Itoa(width)
Expand All @@ -327,8 +335,8 @@ func (client *DockerClient) ExecResize(id string, width, height int) error {
v.Set("w", w)
v.Set("h", h)

uri := fmt.Sprintf("/%s/exec/%s/resize?%s", APIVersion, id, v.Encode())
if _, err := client.doRequest("POST", client.URL.String()+uri, nil, nil); err != nil {
uri := fmt.Sprintf("/%s/%s/%s/resize?%s", APIVersion, mode, id, v.Encode())
if _, err := client.doRequest("POST", uri, nil, nil); err != nil {
return err
}

Expand Down