From 3b3499d0fa37386b8359dfb6208e1cb7e3ff806f Mon Sep 17 00:00:00 2001 From: David Sissitka Date: Wed, 7 Aug 2013 05:33:03 -0400 Subject: [PATCH] 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 {