diff --git a/servers/servers.go b/servers/servers.go index 7b412a4..721710e 100644 --- a/servers/servers.go +++ b/servers/servers.go @@ -604,17 +604,20 @@ func (con Connection) AttachServer(ctx *gin.Context) { case "resize": args := strings.Split(Command.Arguments, "x") - width, err2 := strconv.Atoi(args[0]) + i_width, err2 := strconv.Atoi(args[0]) + if err2 != nil { break } - height, err2 := strconv.Atoi(args[1]) + width := uint(i_width) + i_height, err2 := strconv.Atoi(args[1]) if err2 != nil { break } + height := uint(i_height) log.Printf("Fake resize %dx%d", width, height) - err2 = con.dockerClient.ContainerResize(context.TODO(), containers[0].ID, container.ResizeOptions{Height: uint(height), Width: uint(width)}) + err2 = con.dockerClient.ContainerResize(context.TODO(), containers[0].ID, container.ResizeOptions{Height: height, Width: width}) if err2 != nil { log.Printf("Failed to resize container to %dx%d: %s", width, height, err) }