Allow hex for ip6 literal addr, fix #1800 (#1830)

* Allow hex for ip6 literal addr, fix #1800

* Add UT for ipv6 + Universal client implementation

* add /n at EOF
This commit is contained in:
Sean Quinn 2024-05-26 05:57:07 -07:00 committed by GitHub
parent 25b1e0d906
commit 98cc1ec344
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 18 additions and 1 deletions

View file

@ -7373,3 +7373,18 @@ TEST(PathParamsTest, SequenceOfParams) {
EXPECT_EQ(request.path_params, expected_params);
}
TEST(UniversalClientImplTest, Ipv6LiteralAddress) {
// If ipv6 regex working, regex match codepath is taken.
// else port will default to 80 in Client impl
int clientImplMagicPort = 80;
int port = 4321;
// above ports must be different to avoid false negative
EXPECT_NE(clientImplMagicPort, port);
std::string ipV6TestURL = "http://[ff06::c3]";
Client cli(ipV6TestURL + ":" + std::to_string(port), CLIENT_CERT_FILE,
CLIENT_PRIVATE_KEY_FILE);
EXPECT_EQ(cli.port(), port);
}