File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 "strings"
77 "testing"
88
9- "github.com/docker/cli/cli/command"
109 "github.com/docker/cli/internal/test/environment"
1110 "gotest.tools/v3/assert"
1211 "gotest.tools/v3/icmd"
@@ -48,7 +47,7 @@ func TestTCPSchemeUsesHTTPProxyEnv(t *testing.T) {
4847 const responseJSON = `{"Version": "99.99.9", "ApiVersion": "1.41", "MinAPIVersion": "1.12"}`
4948 var received string
5049 proxyServer := httptest .NewServer (http .HandlerFunc (func (w http.ResponseWriter , r * http.Request ) {
51- received = r .Header . Get ( "User-Agent" )
50+ received = r .Host
5251 w .Header ().Set ("Content-Type" , "application/json" )
5352 _ , _ = w .Write ([]byte (responseJSON ))
5453 }))
@@ -64,5 +63,5 @@ func TestTCPSchemeUsesHTTPProxyEnv(t *testing.T) {
6463 // Verify the command ran successfully, and that it connected to the proxyServer
6564 result .Assert (t , icmd .Success )
6665 assert .Equal (t , strings .TrimSpace (result .Stdout ()), "99.99.9" )
67- assert .Equal (t , received , command . UserAgent () )
66+ assert .Equal (t , received , "docker.acme.example.com:2376" )
6867}
You can’t perform that action at this time.
0 commit comments