client: use canonical names for HTTP Headers
@@ -238,14 +238,14 @@ func (cli *Client) addHeaders(req *http.Request, headers headers) *http.Request
// Add CLI Config's HTTP Headers BEFORE we set the Docker headers
// then the user can't change OUR headers
for k, v := range cli.customHTTPHeaders {
- if versions.LessThan(cli.version, "1.25") && k == "User-Agent" {
+ if versions.LessThan(cli.version, "1.25") && http.CanonicalHeaderKey(k) == "User-Agent" {
continue
}
req.Header.Set(k, v)
}
for k, v := range headers {
- req.Header[k] = v
+ req.Header[http.CanonicalHeaderKey(k)] = v
}
return req
}
