瀏覽代碼

Use the official mime type that exists instead of an imaginary one that does not.

Signed-off-by: Jean-Paul Calderone <exarkun@twistedmatrix.com>

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@linux.com> (github: jfrazelle)
Jean-Paul Calderone 10 年之前
父節點
當前提交
f29ee87051
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      api/client/hijack.go
  2. 3 3
      api/client/utils.go

+ 1 - 1
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

+ 3 - 3
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)
 		}
 	}()