Started rewrite of HTTPServer.

This commit is contained in:
EinMByte 2015-09-06 20:34:50 +02:00
parent 3d30b4bbbc
commit e7350a3af4
6 changed files with 269 additions and 1066 deletions

View file

@ -125,6 +125,7 @@ BOOST_AUTO_TEST_CASE(HTTPResponseStatusMessage)
BOOST_CHECK_EQUAL(Response(502).getStatusMessage(), "Not Implemented");
BOOST_CHECK_EQUAL(Response(504).getStatusMessage(), "Gateway Timeout");
}
BOOST_AUTO_TEST_CASE(WriteHTTPResponse)
{
Response rsp(200);
@ -136,5 +137,16 @@ BOOST_AUTO_TEST_CASE(WriteHTTPResponse)
);
}
BOOST_AUTO_TEST_CASE(WriteHTTPResponseWithContent)
{
Response rsp(200, "Test content.");
rsp.setHeader("Connection", "close");
BOOST_CHECK_EQUAL(
rsp.toString(),
"HTTP/1.1 200 OK\r\n"
"Connection: close\r\n\r\n"
"Test content."
);
}
BOOST_AUTO_TEST_SUITE_END()