}
public void testParsingEmptyFoldedHeader() throws Exception {
SessionInputBuffer inbuf = new SessionInputBuffer(1024, 128);
HttpRequestFactory requestFactory = new DefaultHttpRequestFactory();
HttpRequestParser requestParser = new HttpRequestParser(inbuf, requestFactory);
requestParser.fillBuffer(newChannel("GET /whatev"));
HttpRequest request = (HttpRequest) requestParser.parse();
assertNull(request);
requestParser.fillBuffer(newChannel("er HTTP/1.1\r"));
request = (HttpRequest) requestParser.parse();
assertNull(request);
requestParser.fillBuffer(newChannel("\n Some header: stuff\r\n"));
request = (HttpRequest) requestParser.parse();
assertNull(request);
requestParser.fillBuffer(newChannel(" \r\n"));
request = (HttpRequest) requestParser.parse();
assertNull(request);
requestParser.fillBuffer(newChannel(" more stuff\r\n"));
request = (HttpRequest) requestParser.parse();
assertNull(request);
requestParser.fillBuffer(newChannel("\r\n"));
request = (HttpRequest) requestParser.parse();
assertNotNull(request);
assertEquals("/whatever", request.getRequestLine().getUri());
assertEquals(1, request.getAllHeaders().length);
assertEquals("stuff more stuff", request.getFirstHeader("Some header").getValue());