mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
testutil: use dummyhost for non-tcp connections
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit e1db9e9848)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -236,6 +236,11 @@ func requestHijack(method, endpoint string, data io.Reader, ct, daemon string, m
|
||||
req.URL.Scheme = "http"
|
||||
req.URL.Host = hostURL.Host
|
||||
|
||||
if hostURL.Scheme == "unix" || hostURL.Scheme == "npipe" {
|
||||
// Override host header for non-tcp connections.
|
||||
req.Host = client.DummyHost
|
||||
}
|
||||
|
||||
for _, opt := range modifiers {
|
||||
opt(req)
|
||||
}
|
||||
|
||||
@@ -125,6 +125,11 @@ func newRequest(endpoint string, opts *Options) (*http.Request, error) {
|
||||
}
|
||||
req.URL.Host = hostURL.Host
|
||||
|
||||
if hostURL.Scheme == "unix" || hostURL.Scheme == "npipe" {
|
||||
// Override host header for non-tcp connections.
|
||||
req.Host = client.DummyHost
|
||||
}
|
||||
|
||||
for _, config := range opts.requestModifiers {
|
||||
if err := config(req); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user