diff options
-rw-r--r-- | src/Uri.cpp | 6 | ||||
-rw-r--r-- | test/src/UriTests.cpp | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Uri.cpp b/src/Uri.cpp index 191aafd..73bdfc3 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -381,8 +381,10 @@ namespace { } ++position; } - // TODO: should also catch IN_GROUP_NOT_IPV4 - if (state == ValidationState::IN_GROUP_COULD_BE_IPV4) { + if ( + (state == ValidationState::IN_GROUP_NOT_IPV4) + || (state == ValidationState::IN_GROUP_COULD_BE_IPV4) + ) { // count trailing group ++numGroups; } diff --git a/test/src/UriTests.cpp b/test/src/UriTests.cpp index 027c045..d8dca7a 100644 --- a/test/src/UriTests.cpp +++ b/test/src/UriTests.cpp @@ -723,6 +723,7 @@ TEST(UriTests, IPv6Address) { {"http://[::ffff:1.2.3.4]/", "::ffff:1.2.3.4", true}, {"http://[2001:db8:85a3:8d3:1319:8a2e:370:7348]/", "2001:db8:85a3:8d3:1319:8a2e:370:7348", true}, {"http://[fFfF::1]", "fFfF::1", true}, + {"http://[fFfF:1:2:3:4:5:6:a]", "fFfF:1:2:3:4:5:6:a", true}, // invalid {"http://[::fFfF::1]", "", false}, |