public void verifyThatLeadingSpacesAreRemovedFromHeader() throws UnsupportedEncodingException,
ProtocolDecoderException {
String reqStr = "GET / HTTP/1.0\r\nHost: localhost\r\n\r\n";
ByteBuffer buffer = ByteBuffer.allocate(reqStr.length());
buffer.put(reqStr.getBytes("US-ASCII"));
buffer.rewind();
HttpServerDecoder decoder = new HttpServerDecoder();
HttpDecoderState state = decoder.createDecoderState();
HttpPdu pdus = decoder.decode(buffer, state);
assertNotNull(pdus);
assertEquals("localhost", ((HttpRequestImpl) pdus).getHeader("host"));