diff --git a/helpers.go b/helpers.go index 464304cd..8c53cbf4 100644 --- a/helpers.go +++ b/helpers.go @@ -307,10 +307,6 @@ func isEtagStale(etag string, noneMatchBytes []byte) bool { return !matchEtag(getString(noneMatchBytes[start:end]), etag) } -func isIPv6(address string) bool { - return strings.Count(address, ":") >= 2 -} - func parseAddr(raw string) (host, port string) { if i := strings.LastIndex(raw, ":"); i != -1 { return raw[:i], raw[i+1:] diff --git a/helpers_test.go b/helpers_test.go index 223eee2c..5b198694 100644 --- a/helpers_test.go +++ b/helpers_test.go @@ -209,30 +209,6 @@ func Benchmark_Utils_Unescape(b *testing.B) { utils.AssertEqual(b, "/créer", unescaped) } -func Test_Utils_IPv6(t *testing.T) { - testCases := []struct { - string - bool - }{ - {"::FFFF:C0A8:1:3000", true}, - {"::FFFF:C0A8:0001:3000", true}, - {"0000:0000:0000:0000:0000:FFFF:C0A8:1:3000", true}, - {"::FFFF:C0A8:1%1:3000", true}, - {"::FFFF:192.168.0.1:3000", true}, - {"[::FFFF:C0A8:1]:3000", true}, - {"[::FFFF:C0A8:1%1]:3000", true}, - {":3000", false}, - {"127.0.0.1:3000", false}, - {"127.0.0.1:", false}, - {"0.0.0.0:3000", false}, - {"", false}, - } - - for _, c := range testCases { - utils.AssertEqual(t, c.bool, isIPv6(c.string)) - } -} - func Test_Utils_Parse_Address(t *testing.T) { testCases := []struct { addr, host, port string