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 authored and GitHub committed 2024-09-06 08:48:51 -04:00
1 parent 2480c0342c
commit 80fb03628b
2 files changed
+19 -5

No files matched your search

+12
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