From 3b3499d0fa37386b8359dfb6208e1cb7e3ff806f Mon Sep 17 00:00:00 2001 From: David Sissitka Date: Wed, 7 Aug 2013 05:33:03 -0400 Subject: [PATCH 1/2] Updated the Docker CLI to specify a value for the "Host" header. Upstream-commit: 6bbe66d2e6414a127f0f543c0138f1709bd3b8b4 Component: engine --- components/engine/commands.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/engine/commands.go b/components/engine/commands.go index f0e1695b3f..e0d33d7d36 100644 --- a/components/engine/commands.go +++ b/components/engine/commands.go @@ -1433,6 +1433,7 @@ func (cli *DockerCli) call(method, path string, data interface{}) ([]byte, int, return nil, -1, err } req.Header.Set("User-Agent", "Docker-Client/"+VERSION) + req.Host = cli.addr if data != nil { req.Header.Set("Content-Type", "application/json") } else if method == "POST" { @@ -1474,6 +1475,7 @@ func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer) e return err } req.Header.Set("User-Agent", "Docker-Client/"+VERSION) + req.Host = cli.addr if method == "POST" { req.Header.Set("Content-Type", "plain/text") } @@ -1536,6 +1538,7 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea } req.Header.Set("User-Agent", "Docker-Client/"+VERSION) req.Header.Set("Content-Type", "plain/text") + req.Host = cli.addr dial, err := net.Dial(cli.proto, cli.addr) if err != nil { From b0ec69fb38bb939f1448533d5541b7d702728ff2 Mon Sep 17 00:00:00 2001 From: David Sissitka Date: Wed, 7 Aug 2013 05:35:38 -0400 Subject: [PATCH 2/2] Updated my last commit to use tabs instead of spaces. Upstream-commit: 416d0986886cd322ecae1114c13565bbc27b305c Component: engine --- components/engine/commands.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/engine/commands.go b/components/engine/commands.go index e0d33d7d36..a47de9f2ba 100644 --- a/components/engine/commands.go +++ b/components/engine/commands.go @@ -1433,7 +1433,7 @@ func (cli *DockerCli) call(method, path string, data interface{}) ([]byte, int, return nil, -1, err } req.Header.Set("User-Agent", "Docker-Client/"+VERSION) - req.Host = cli.addr + req.Host = cli.addr if data != nil { req.Header.Set("Content-Type", "application/json") } else if method == "POST" { @@ -1475,7 +1475,7 @@ func (cli *DockerCli) stream(method, path string, in io.Reader, out io.Writer) e return err } req.Header.Set("User-Agent", "Docker-Client/"+VERSION) - req.Host = cli.addr + req.Host = cli.addr if method == "POST" { req.Header.Set("Content-Type", "plain/text") } @@ -1538,7 +1538,7 @@ func (cli *DockerCli) hijack(method, path string, setRawTerminal bool, in io.Rea } req.Header.Set("User-Agent", "Docker-Client/"+VERSION) req.Header.Set("Content-Type", "plain/text") - req.Host = cli.addr + req.Host = cli.addr dial, err := net.Dial(cli.proto, cli.addr) if err != nil {