Skip to content

Commit

Permalink
Merge branch 'jetty-9.4.x' into jetty-9.4.x-ewyk
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Mar 17, 2017
2 parents 0b2b9ea + 67ec4b0 commit c01a910
Showing 1 changed file with 15 additions and 8 deletions.
Expand Up @@ -143,21 +143,28 @@ protected void doNonErrorHandle(String target, Request jettyRequest, HttpServlet
{
client.setSoTimeout(5000);

String request = "" +
try
{
String request = "" +
"GET / HTTP/1.1\r\n" +
"Host: localhost\r\n" +
"Transfer-Encoding: chunked\r\n" +
"\r\n" +
"0\r\n" +
"Trailer: " + new String(huge) + "\r\n" +
"\r\n";
OutputStream output = client.getOutputStream();
output.write(request.getBytes(StandardCharsets.UTF_8));
output.flush();

HttpTester.Response response = HttpTester.parseResponse(HttpTester.from(client.getInputStream()));
Assert.assertNotNull(response);
Assert.assertEquals(HttpStatus.OK_200, response.getStatus());
OutputStream output = client.getOutputStream();
output.write(request.getBytes(StandardCharsets.UTF_8));
output.flush();

HttpTester.Response response = HttpTester.parseResponse(HttpTester.from(client.getInputStream()));
Assert.assertNotNull(response);
Assert.assertEquals(HttpStatus.OK_200, response.getStatus());
}
catch(Exception e)
{
// May be thrown if write fails and error handling is aborted
}
}
}
}

0 comments on commit c01a910

Please sign in to comment.