Bug fixes. HTTP parsing improvements. More tests.
Fixed TcpSocket::set_descriptor(nullptr) causing an invalid read from address 0x0. Improved HTTP response/request parsing so that they report a parse failure if the first few bytes of the HTTP request don't match the expected format rather than continuing to look for an end of header. Fixed broken fr::Http::url_encode() implementation. Optimised fr::Http::url_decode() implementation. Added fr::Http unit tests.
This commit is contained in:
@@ -92,6 +92,7 @@ TEST(HttpResponseTest, header_length_test)
|
||||
//Try data with no header end first
|
||||
std::string buff(MAX_HTTP_HEADER_SIZE + 1, '\0');
|
||||
fr::HttpResponse response;
|
||||
buff.insert(0, "HTTP");
|
||||
ASSERT_EQ(response.parse(buff.c_str(), buff.size()), fr::Socket::HttpHeaderTooBig);
|
||||
response = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user