@@ -397,37 +397,3 @@ func TestWithProxyTransport_ProxyRejectsConnect(t *testing.T) {
397397 })
398398 }
399399}
400-
401- func TestProxyDialAddr (t * testing.T ) {
402- tests := []struct {
403- name string
404- url string
405- want string
406- }{
407- {"https with port" , "https://proxy.example.com:8443" , "proxy.example.com:8443" },
408- {"https without port" , "https://proxy.example.com" , "proxy.example.com:443" },
409- {"http with port" , "http://proxy.example.com:8080" , "proxy.example.com:8080" },
410- {"http without port" , "http://proxy.example.com" , "proxy.example.com:80" },
411- {"ipv4 with port" , "http://192.168.1.100:3128" , "192.168.1.100:3128" },
412- {"ipv4 without port https" , "https://10.0.0.1" , "10.0.0.1:443" },
413- {"ipv4 without port http" , "http://172.16.0.5" , "172.16.0.5:80" },
414- {"ipv6 with port" , "http://[::1]:8080" , "[::1]:8080" },
415- {"ipv6 without port https" , "https://[2001:db8::1]" , "[2001:db8::1]:443" },
416- {"ipv6 without port http" , "http://[fe80::1]" , "[fe80::1]:80" },
417- {"localhost with port" , "http://localhost:9090" , "localhost:9090" },
418- {"localhost without port https" , "https://localhost" , "localhost:443" },
419- {"localhost without port http" , "http://localhost" , "localhost:80" },
420- }
421- for _ , tt := range tests {
422- t .Run (tt .name , func (t * testing.T ) {
423- u , err := url .ParseRequestURI (tt .url )
424- if err != nil {
425- t .Fatalf ("parse URL: %v" , err )
426- }
427- got := proxyDialAddr (u )
428- if got != tt .want {
429- t .Errorf ("proxyHostPort(%s) = %q, want %q" , tt .url , got , tt .want )
430- }
431- })
432- }
433- }
0 commit comments