From 513f1cf7d94e484d40589f11e72e623eeef4e61e Mon Sep 17 00:00:00 2001 From: Joshua Casey Date: Tue, 14 Oct 2025 10:34:58 -0500 Subject: [PATCH] Update net/url as per https://github.com/golang/go/issues/75713 --- internal/endpointaddr/endpointaddr_test.go | 27 ++-------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/internal/endpointaddr/endpointaddr_test.go b/internal/endpointaddr/endpointaddr_test.go index 13e203e84..849df78e7 100644 --- a/internal/endpointaddr/endpointaddr_test.go +++ b/internal/endpointaddr/endpointaddr_test.go @@ -224,13 +224,6 @@ func TestParseFromURL(t *testing.T) { expect: HostPort{Host: "127.0.0.1", Port: 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", input: "http://[::127.0.0.1]:8443", @@ -266,13 +259,6 @@ func TestParseFromURL(t *testing.T) { expect: HostPort{Host: "host.example.com", Port: 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", input: "http://localhost", @@ -339,17 +325,8 @@ func TestParseFromURL(t *testing.T) { name: "IPv6 with mismatched leading bracket will err on bracket", input: "https://[[::1]/some/fake/path", defaultPort: 443, - expect: HostPort{Host: "[[::1]", Port: 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`, + expect: HostPort{Host: "::1", Port: 443}, + expectEndpoint: "[::1]:443", }, } { t.Run(tt.name, func(t *testing.T) {