mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 09:18:27 +00:00
Fix: Query parameter including query delimiter ('?') not being parsed properly (#1713)
* Fix: Query parameter including query delimiter ('?') not being parsed properly * Add details::split function with and without m argument to allow split parameters with/without counter * Revert changes in SplitTest.ParseQueryString
This commit is contained in:
parent
f14accb7b6
commit
e426a38c3e
2 changed files with 26 additions and 2 deletions
13
test/test.cc
13
test/test.cc
|
@ -1847,6 +1847,11 @@ protected:
|
|||
return true;
|
||||
});
|
||||
})
|
||||
.Get("/regex-with-delimiter",
|
||||
[&](const Request & req, Response &res) {
|
||||
ASSERT_TRUE(req.has_param("key"));
|
||||
EXPECT_EQ("^(?.*(value))", req.get_param_value("key"));
|
||||
})
|
||||
.Get("/with-range",
|
||||
[&](const Request & /*req*/, Response &res) {
|
||||
res.set_content("abcdefg", "text/plain");
|
||||
|
@ -3352,6 +3357,14 @@ TEST_F(ServerTest, GetStreamedChunkedWithGzip2) {
|
|||
EXPECT_EQ(std::string("123456789"), res->body);
|
||||
}
|
||||
|
||||
|
||||
TEST_F(ServerTest, SplitDelimiterInPathRegex) {
|
||||
auto res = cli_.Get("/regex-with-delimiter?key=^(?.*(value))");
|
||||
ASSERT_TRUE(res);
|
||||
EXPECT_EQ(200, res->status);
|
||||
}
|
||||
|
||||
|
||||
TEST(GzipDecompressor, ChunkedDecompression) {
|
||||
std::string data;
|
||||
for (size_t i = 0; i < 32 * 1024; ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue