You've already forked cpp-httplib
Fix #95
This commit is contained in:
12
test/test.cc
12
test/test.cc
@ -398,6 +398,10 @@ protected:
|
||||
EXPECT_EQ(0u, file.length);
|
||||
}
|
||||
})
|
||||
.Post("/empty", [&](const Request& req, Response& res) {
|
||||
EXPECT_EQ(req.body, "");
|
||||
res.set_content("empty", "text/plain");
|
||||
})
|
||||
.Put("/put", [&](const Request& req, Response& res) {
|
||||
EXPECT_EQ(req.body, "PUT");
|
||||
res.set_content(req.body, "text/plain");
|
||||
@ -560,6 +564,14 @@ TEST_F(ServerTest, PostMethod2)
|
||||
ASSERT_EQ("coder", res->body);
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, PostEmptyContent)
|
||||
{
|
||||
auto res = cli_.Post("/empty", "", "text/plain");
|
||||
ASSERT_TRUE(res != nullptr);
|
||||
ASSERT_EQ(200, res->status);
|
||||
ASSERT_EQ("empty", res->body);
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, GetMethodDir)
|
||||
{
|
||||
auto res = cli_.Get("/dir/");
|
||||
|
Reference in New Issue
Block a user