mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
keepalive: support multiple post using content provider (#461)
This commit is contained in:
parent
31bb13abd2
commit
d043b18097
2 changed files with 18 additions and 2 deletions
|
@ -2088,6 +2088,7 @@ TEST_F(ServerTest, KeepAlive) {
|
|||
Get(requests, "/hi");
|
||||
Get(requests, "/not-exist");
|
||||
Post(requests, "/empty", "", "text/plain");
|
||||
Post(requests, "/empty", 0, [&](size_t offset, size_t length, httplib::DataSink &sink){}, "text/plain");
|
||||
|
||||
std::vector<Response> responses;
|
||||
auto ret = cli_.send(requests, responses);
|
||||
|
@ -2107,8 +2108,8 @@ TEST_F(ServerTest, KeepAlive) {
|
|||
EXPECT_EQ(404, res.status);
|
||||
}
|
||||
|
||||
{
|
||||
auto &res = responses[4];
|
||||
for (size_t i = 4; i < 6; i++) {
|
||||
auto &res = responses[i];
|
||||
EXPECT_EQ(200, res.status);
|
||||
EXPECT_EQ("text/plain", res.get_header_value("Content-Type"));
|
||||
EXPECT_EQ("empty", res.body);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue