mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-14 16:58:30 +00:00
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:
parent
2480c0342c
commit
80fb03628b
2 changed files with 19 additions and 5 deletions
12
test/test.cc
12
test/test.cc
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue