Add unit test for #609
This commit is contained in:
parent
708f860e3a
commit
eb10c22db1
12
test/test.cc
12
test/test.cc
@ -2977,6 +2977,11 @@ protected:
|
|||||||
res.status = 401;
|
res.status = 401;
|
||||||
res.set_header("WWW-Authenticate", "Basic realm=123456");
|
res.set_header("WWW-Authenticate", "Basic realm=123456");
|
||||||
})
|
})
|
||||||
|
.Delete("/issue609",
|
||||||
|
[](const httplib::Request &, httplib::Response &res,
|
||||||
|
const httplib::ContentReader &) {
|
||||||
|
res.set_content("ok", "text/plain");
|
||||||
|
})
|
||||||
#if defined(CPPHTTPLIB_ZLIB_SUPPORT) || defined(CPPHTTPLIB_BROTLI_SUPPORT)
|
#if defined(CPPHTTPLIB_ZLIB_SUPPORT) || defined(CPPHTTPLIB_BROTLI_SUPPORT)
|
||||||
.Get("/compress",
|
.Get("/compress",
|
||||||
[&](const Request & /*req*/, Response &res) {
|
[&](const Request & /*req*/, Response &res) {
|
||||||
@ -4048,6 +4053,13 @@ TEST_F(ServerTest, Issue1772) {
|
|||||||
EXPECT_EQ(StatusCode::Unauthorized_401, res->status);
|
EXPECT_EQ(StatusCode::Unauthorized_401, res->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(ServerTest, Issue609) {
|
||||||
|
auto res = cli_.Delete("/issue609");
|
||||||
|
ASSERT_TRUE(res);
|
||||||
|
EXPECT_EQ(StatusCode::OK_200, res->status);
|
||||||
|
EXPECT_EQ(std::string("ok"), res->body);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(ServerTest, GetStreamedChunked) {
|
TEST_F(ServerTest, GetStreamedChunked) {
|
||||||
auto res = cli_.Get("/streamed-chunked");
|
auto res = cli_.Get("/streamed-chunked");
|
||||||
ASSERT_TRUE(res);
|
ASSERT_TRUE(res);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user