From f29ee870512e8809bfc396c1771fd74235c9de7b Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 7 Jan 2015 11:19:14 -0500 Subject: [PATCH 1/3] Use the official mime type that exists instead of an imaginary one that does not. Signed-off-by: Jean-Paul Calderone Docker-DCO-1.1-Signed-off-by: Jessica Frazelle (github: jfrazelle) --- api/client/hijack.go | 2 +- api/client/utils.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/client/hijack.go b/api/client/hijack.go index bd302a764d..987f2d23fa 100644 --- a/api/client/hijack.go +++ b/api/client/hijack.go @@ -134,7 +134,7 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea return err } req.Header.Set("User-Agent", "Docker-Client/"+dockerversion.VERSION) - req.Header.Set("Content-Type", "plain/text") + req.Header.Set("Content-Type", "text/plain") req.Header.Set("Connection", "Upgrade") req.Header.Set("Upgrade", "tcp") req.Host = cli.addr diff --git a/api/client/utils.go b/api/client/utils.go index 6ebe448062..a65ceb352c 100644 --- a/api/client/utils.go +++ b/api/client/utils.go @@ -89,7 +89,7 @@ func (cli *DockerCli) call(method, path string, data interface{}, passAuthInfo b if data != nil { req.Header.Set("Content-Type", "application/json") } else if method == "POST" { - req.Header.Set("Content-Type", "plain/text") + req.Header.Set("Content-Type", "text/plain") } resp, err := cli.HTTPClient().Do(req) if err != nil { @@ -135,7 +135,7 @@ func (cli *DockerCli) streamHelper(method, path string, setRawTerminal bool, in req.URL.Host = cli.addr req.URL.Scheme = cli.scheme if method == "POST" { - req.Header.Set("Content-Type", "plain/text") + req.Header.Set("Content-Type", "text/plain") } if headers != nil { @@ -260,7 +260,7 @@ func (cli *DockerCli) monitorTtySize(id string, isExec bool) error { sigchan := make(chan os.Signal, 1) gosignal.Notify(sigchan, signal.SIGWINCH) go func() { - for _ = range sigchan { + for range sigchan { cli.resizeTty(id, isExec) } }() From 807f486f874d87adb423d486944f5dc59842f1eb Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Wed, 7 Jan 2015 11:19:52 -0500 Subject: [PATCH 2/3] Change some instances of this mistake in the documentation as well. Signed-off-by: Jean-Paul Calderone Docker-DCO-1.1-Signed-off-by: Jessica Frazelle (github: jfrazelle) --- docs/sources/reference/api/docker_remote_api_v1.17.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sources/reference/api/docker_remote_api_v1.17.md b/docs/sources/reference/api/docker_remote_api_v1.17.md index aaaffda854..67b862302f 100644 --- a/docs/sources/reference/api/docker_remote_api_v1.17.md +++ b/docs/sources/reference/api/docker_remote_api_v1.17.md @@ -1616,12 +1616,12 @@ This API is valid only if `tty` was specified as part of creating and starting t **Example request**: POST /exec/e90e34656806/resize HTTP/1.1 - Content-Type: plain/text + Content-Type: text/plain **Example response**: HTTP/1.1 201 OK - Content-Type: plain/text + Content-Type: text/plain Query Parameters: From cd5902fc7bb0da36fedb6ff6a1bb8ef200b212d9 Mon Sep 17 00:00:00 2001 From: Jessica Frazelle Date: Mon, 12 Jan 2015 11:49:52 -0800 Subject: [PATCH 3/3] Fix range for go 1.3 Docker-DCO-1.1-Signed-off-by: Jessica Frazelle (github: jfrazelle) --- api/client/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/client/utils.go b/api/client/utils.go index a65ceb352c..86e221ebf4 100644 --- a/api/client/utils.go +++ b/api/client/utils.go @@ -260,7 +260,7 @@ func (cli *DockerCli) monitorTtySize(id string, isExec bool) error { sigchan := make(chan os.Signal, 1) gosignal.Notify(sigchan, signal.SIGWINCH) go func() { - for range sigchan { + for _ = range sigchan { cli.resizeTty(id, isExec) } }()