Community
Participate
Working Groups
Build Identifier: Using ServletTester, given the following response to a HEAD request: ---- HTTP/1.1 200 OK Content-Type: text/html Content-Length: 22 ---- Calling HttpTester.parse(response) results in an EOFException: java.io.EOFException at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:309) at org.eclipse.jetty.http.HttpParser.parse(HttpParser.java:204) at org.eclipse.jetty.testing.HttpTester.parse(HttpTester.java:139) The HttpTester does not know that this was a response to a HEAD call so it should not expect a body. This worked through Jetty 7.5.1. The breaking commit appears to be 12469af49929800e47d13dd71d5c46894f34f17a. The HttpParser has a flag for whether to expect a HEAD response, but HttpTester does not know whether it is a HEAD response or not. Reproducible: Always Steps to Reproduce: public void testParseHeadResponse() throws Exception { String response = "HTTP/1.1 200 OK\r\n"+ "Content-Type: text/html\r\n"+ "Content-Length: 22\r\n"+ "\r\n"; new HttpTester().parse(response); }
Fixed for jetty-7.6.0. added HttpTester.parse(String string, boolean isHeadResponse) and HttpTester.parse(byte[] bytes, boolean isHeadResponse).