Test for issue where POST requests time out
parent
1f2ecdd365
commit
0aa588aecf
|
@ -86,3 +86,19 @@ TEST_CASE("Test parse POST then GET", "[RequestParser][POSTthenGET]")
|
|||
CHECK_THAT(request.getUrl(), Equals("/foo"));
|
||||
CHECK_THAT(request.getMethod(), Equals("GET"));
|
||||
}
|
||||
|
||||
TEST_CASE("More POST testing", "[RequestParser][POST]")
|
||||
{
|
||||
uint8_t buff[512] = {};
|
||||
Buffer client(buff, 512);
|
||||
HttpRequest request;
|
||||
RequestParser parser(request, client);
|
||||
|
||||
client.write("POST / HTTP/1.1\r\nHost: localhost:8080\r\nUser-Agent: curl/7.55.1\r\nAccept: */*\r\nContent-Length: 3\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\nfoo");
|
||||
CHECK(parser.parse());
|
||||
CHECK(!client.available());
|
||||
CHECK_THAT(request.getUrl(), Equals("/"));
|
||||
CHECK_THAT(request.headers.get("Host"), Equals("localhost:8080"));
|
||||
CHECK_THAT(request.headers.get("Content-Length"), Equals("3"));
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue