mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-28 03:20:11 +01:00
SF#3500438: HTTPResponse failure when reason is empty
This commit is contained in:
@@ -107,6 +107,21 @@ void HTTPResponseTest::testRead2()
|
||||
}
|
||||
|
||||
|
||||
void HTTPResponseTest::testRead3()
|
||||
{
|
||||
std::string s("HTTP/1.1 200 \r\nContent-Length: 0\r\n\r\n");
|
||||
std::istringstream istr(s);
|
||||
HTTPResponse response;
|
||||
response.read(istr);
|
||||
assert (response.getVersion() == HTTPMessage::HTTP_1_1);
|
||||
assert (response.getStatus() == HTTPResponse::HTTP_OK);
|
||||
assert (response.getReason() == "");
|
||||
assert (response.size() == 1);
|
||||
assert (response.getContentLength() == 0);
|
||||
assert (istr.get() == -1);
|
||||
}
|
||||
|
||||
|
||||
void HTTPResponseTest::testInvalid1()
|
||||
{
|
||||
std::string s(256, 'x');
|
||||
@@ -226,6 +241,7 @@ CppUnit::Test* HTTPResponseTest::suite()
|
||||
CppUnit_addTest(pSuite, HTTPResponseTest, testWrite2);
|
||||
CppUnit_addTest(pSuite, HTTPResponseTest, testRead1);
|
||||
CppUnit_addTest(pSuite, HTTPResponseTest, testRead2);
|
||||
CppUnit_addTest(pSuite, HTTPResponseTest, testRead3);
|
||||
CppUnit_addTest(pSuite, HTTPResponseTest, testInvalid1);
|
||||
CppUnit_addTest(pSuite, HTTPResponseTest, testInvalid2);
|
||||
CppUnit_addTest(pSuite, HTTPResponseTest, testInvalid3);
|
||||
|
||||
Reference in New Issue
Block a user