mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-10 09:43:51 +00:00
Fixed build errors and adjusted a test case.
This commit is contained in:
parent
f3eb1c4e00
commit
7cdf62dd31
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
CC = clang++
|
CC = clang++
|
||||||
CFLAGS = -std=c++14 -I..
|
CFLAGS = -std=c++14 -I..
|
||||||
#OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib -lssl -lcrypto
|
OPENSSL_SUPPORT = -DCPPHTTPLIB_OPENSSL_SUPPORT -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib -lssl -lcrypto
|
||||||
|
|
||||||
all: server client hello simplesvr
|
all: server client hello simplesvr
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ std::string log(const Request& req, const Response& res)
|
|||||||
|
|
||||||
s += "================================\n";
|
s += "================================\n";
|
||||||
|
|
||||||
snprintf(buf, sizeof(buf), "%s %s", req.method.c_str(), req.url.c_str());
|
snprintf(buf, sizeof(buf), "%s %s", req.method.c_str(), req.path.c_str());
|
||||||
s += buf;
|
s += buf;
|
||||||
|
|
||||||
std::string query;
|
std::string query;
|
||||||
|
12
test/test.cc
12
test/test.cc
@ -267,7 +267,17 @@ TEST_F(ServerTest, GetMethodDir)
|
|||||||
ASSERT_TRUE(res != nullptr);
|
ASSERT_TRUE(res != nullptr);
|
||||||
EXPECT_EQ(200, res->status);
|
EXPECT_EQ(200, res->status);
|
||||||
EXPECT_EQ("text/html", res->get_header_value("Content-Type"));
|
EXPECT_EQ("text/html", res->get_header_value("Content-Type"));
|
||||||
EXPECT_EQ("index.html", res->body);
|
|
||||||
|
auto body = R"(<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a href="/dir/test.html">Test</a>
|
||||||
|
<a href="/hi">hi</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
)";
|
||||||
|
EXPECT_EQ(body, res->body);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(ServerTest, GetMethodDirTest)
|
TEST_F(ServerTest, GetMethodDirTest)
|
||||||
|
@ -1 +1,8 @@
|
|||||||
index.html
|
<html>
|
||||||
|
<head>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<a href="/dir/test.html">Test</a>
|
||||||
|
<a href="/hi">hi</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user