Adding testcase for reported 400 Bad request error in jetty-user mailing list

This commit is contained in:
Joakim Erdfelt 2015-08-13 14:46:10 -07:00
parent 791896339d
commit 29c223cd8f
1 changed files with 13 additions and 0 deletions

View File

@ -81,6 +81,19 @@ public class HttpParserTest
assertEquals(HttpMethod.GET,HttpMethod.lookAheadGet(b));
}
@Test
public void testLineParse_Mock_IP() throws Exception
{
ByteBuffer buffer= BufferUtil.toBuffer("POST /mock/127.0.0.1 HTTP/1.1\015\012" + "\015\012");
HttpParser.RequestHandler<ByteBuffer> handler = new Handler();
HttpParser parser= new HttpParser(handler);
parseAll(parser,buffer);
assertEquals("POST", _methodOrVersion);
assertEquals("/mock/127.0.0.1", _uriOrStatus);
assertEquals("HTTP/1.1", _versionOrReason);
assertEquals(-1, _headers);
}
@Test
public void testLineParse0() throws Exception