testutil: use dummyhost for non-tcp connections

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-07-12 17:37:01 +02:00
parent 6b7705d5b2
commit e1db9e9848
2 changed files with 10 additions and 0 deletions

View File

@@ -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)
}