This repository was archived by the owner on Nov 23, 2019. It is now read-only.
This repository was archived by the owner on Nov 23, 2019. It is now read-only.
Engine-api built with Go(<=1.4) won't work with Docker daemon built with Go(>=1.6) #189 DescriptionWhen using engine-api built with Go(<=1.4) with Docker daemon built with Go(>=1.6), it keeps complaining "Error response from daemon: 400 Bad Request: malformed Host header"
.
I think the reason is that:
request.Host
or request.URL.Host
(if the former is empty) (See here)unix:///var/run/docker.sock
), engine-api will set request.Host=""
, request.URL.Host="/var/run/docker.sock"
(See set request.URL.Host and set request.Host)request.Host
and request.URL.Host
to "". Then the HTTP Host header will be "". (See net/http: does not verify validity of Host header golang/go#11206))"/var/run/docker.sock"
. It will break Go 1.6 http server side validation in 1. because '/'
is not a valid character, causing 400 Bad Request: malformed Host header
.I could fix this by set some random but valid thing like "docker.sock" in the request.URL.Host
. If it is not used for unix endpoint, why don't we just set it to a valid Host?
Hope this could be fixed, thanks! :)
More information kubernetes/kubernetes#23809
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4