Only match path params that span full path segment (#1919)

* Only match path params that span full path segment

* Fix C++11 build
This commit is contained in:
bgs99 2024-09-06 15:48:51 +03:00 committed by GitHub
parent 2480c0342c
commit 80fb03628b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 5 deletions

View file

@ -7599,6 +7599,18 @@ TEST(PathParamsTest, SequenceOfParams) {
EXPECT_EQ(request.path_params, expected_params);
}
TEST(PathParamsTest, SemicolonInTheMiddleIsNotAParam) {
const auto pattern = "/prefix:suffix";
detail::PathParamsMatcher matcher(pattern);
Request request;
request.path = "/prefix:suffix";
ASSERT_TRUE(matcher.match(request));
const std::unordered_map<std::string, std::string> expected_params = {};
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