mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-16 17:58:28 +00:00
Fix #72
This commit is contained in:
parent
5a78e1c457
commit
5b3187e2f9
2 changed files with 19 additions and 5 deletions
12
test/test.cc
12
test/test.cc
|
@ -329,6 +329,11 @@ protected:
|
|||
.Options(R"(\*)", [&](const Request& /*req*/, Response& res) {
|
||||
res.set_header("Allow", "GET, POST, HEAD, OPTIONS");
|
||||
})
|
||||
.Get("/request-target", [&](const Request& req, Response& /*res*/) {
|
||||
EXPECT_EQ("/request-target?aaa=bbb&ccc=ddd", req.target);
|
||||
EXPECT_EQ("bbb", req.get_param_value("aaa"));
|
||||
EXPECT_EQ("ddd", req.get_param_value("ccc"));
|
||||
})
|
||||
#ifdef CPPHTTPLIB_ZLIB_SUPPORT
|
||||
.Get("/gzip", [&](const Request& /*req*/, Response& res) {
|
||||
res.set_content("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890", "text/plain");
|
||||
|
@ -773,6 +778,13 @@ TEST_F(ServerTest, Options)
|
|||
EXPECT_TRUE(res->body.empty());
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, URL)
|
||||
{
|
||||
auto res = cli_.Get("/request-target?aaa=bbb&ccc=ddd");
|
||||
ASSERT_TRUE(res != nullptr);
|
||||
EXPECT_EQ(200, res->status);
|
||||
}
|
||||
|
||||
#ifdef CPPHTTPLIB_ZLIB_SUPPORT
|
||||
TEST_F(ServerTest, Gzip)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue