mirror of
https://github.com/vmware-tanzu/pinniped.git
synced 2025-12-23 14:25:50 +00:00
Update net/url as per https://github.com/golang/go/issues/75713
This commit is contained in:
@@ -224,13 +224,6 @@ func TestParseFromURL(t *testing.T) {
|
|||||||
expect: HostPort{Host: "127.0.0.1", Port: 8443},
|
expect: HostPort{Host: "127.0.0.1", Port: 8443},
|
||||||
expectEndpoint: "127.0.0.1:8443",
|
expectEndpoint: "127.0.0.1:8443",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "IPv4 in brackets with port",
|
|
||||||
input: "http://[127.0.0.1]:8443",
|
|
||||||
defaultPort: 443,
|
|
||||||
expect: HostPort{Host: "127.0.0.1", Port: 8443},
|
|
||||||
expectEndpoint: "127.0.0.1:8443",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "IPv4 as IPv6 in brackets with port",
|
name: "IPv4 as IPv6 in brackets with port",
|
||||||
input: "http://[::127.0.0.1]:8443",
|
input: "http://[::127.0.0.1]:8443",
|
||||||
@@ -266,13 +259,6 @@ func TestParseFromURL(t *testing.T) {
|
|||||||
expect: HostPort{Host: "host.example.com", Port: 8443},
|
expect: HostPort{Host: "host.example.com", Port: 8443},
|
||||||
expectEndpoint: "host.example.com:8443",
|
expectEndpoint: "host.example.com:8443",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: "hostname in brackets with port",
|
|
||||||
input: "http://[host.example.com]:8443",
|
|
||||||
defaultPort: 443,
|
|
||||||
expect: HostPort{Host: "host.example.com", Port: 8443},
|
|
||||||
expectEndpoint: "host.example.com:8443",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: "hostname without dots",
|
name: "hostname without dots",
|
||||||
input: "http://localhost",
|
input: "http://localhost",
|
||||||
@@ -339,17 +325,8 @@ func TestParseFromURL(t *testing.T) {
|
|||||||
name: "IPv6 with mismatched leading bracket will err on bracket",
|
name: "IPv6 with mismatched leading bracket will err on bracket",
|
||||||
input: "https://[[::1]/some/fake/path",
|
input: "https://[[::1]/some/fake/path",
|
||||||
defaultPort: 443,
|
defaultPort: 443,
|
||||||
expect: HostPort{Host: "[[::1]", Port: 443},
|
expect: HostPort{Host: "::1", Port: 443},
|
||||||
expectEndpoint: "[[::1]:443",
|
expectEndpoint: "[::1]:443",
|
||||||
expectErr: `address [[::1]:443: unexpected '[' in address`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "IPv6 with mismatched trailing brackets will err on port",
|
|
||||||
input: "https://[::1]]/some/fake/path",
|
|
||||||
defaultPort: 443,
|
|
||||||
expect: HostPort{Host: "[::1]]", Port: 443},
|
|
||||||
expectEndpoint: "[::1]]:443",
|
|
||||||
expectErr: `address [::1]]:443: missing port in address`,
|
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user