Some docker client commands send wrong Host header

Some commands, like “build” send wrong Host header:

When a do:

docker -H tcp://localhost:2374 build -t test .

Docker send:

POST /build?rm=1&t=test HTTP/1.1
Host: v1.14
User-Agent: Docker-Client/1.2.0
Transfer-Encoding: chunked
Content-Type: application/tar
X-Registry-Config: e30=
Accept-Encoding: gzip

It is ok when I do others command like ‘images’

docker -H tcp://localhost:2374 images

Results:

GET /v1.14/images/json HTTP/1.1
Host: localhost:2374
User-Agent: Docker-Client/1.2.0
Accept-Encoding: gzip

Version

Client version: 1.2.0
Client API version: 1.14
Go version (client): go1.3.1
Git commit (client): fa7b24f
OS/Arch (client): linux/amd64
Server version: 1.2.0
Server API version: 1.14
Go version (server): go1.3.1
Git commit (server): fa7b24f

Is it a bug or am I doing something wrong?

This was fixed by https://github.com/docker/docker/pull/8408