@Test
public void testBadHeaderNames() {

    String[] bad = new String[]
            {
                    "Foo\\Bar: value\r\n",
                    "Foo@Bar: value\r\n",
                    "Foo,Bar: value\r\n",
                    "Foo}Bar: value\r\n",
                    "Foo{Bar: value\r\n",
                    "Foo=Bar: value\r\n",
                    "Foo>Bar: value\r\n",
                    "Foo<Bar: value\r\n",
                    "Foo)Bar: value\r\n",
                    "Foo(Bar: value\r\n",
                    "Foo?Bar: value\r\n",
                    "Foo\"Bar: value\r\n",
                    "Foo/Bar: value\r\n",
                    "Foo]Bar: value\r\n",
                    "Foo[Bar: value\r\n",
                    "\u0192\u00f8\u00f8\u00df\u00e5\u00ae: value\r\n"
            };
    for (String s : bad) {
        ByteBuffer buffer = BufferUtils.toBuffer(
                "--AaB03x\r\n" + s + "\r\n--AaB03x--\r\n");
        MultiPartParser.Handler handler = new TestHandler();
        MultiPartParser parser = new MultiPartParser(handler, "AaB03x");
        try {
            parser.parse(buffer, true);
        } catch (BadMessageException e) {
            assertTrue(e.getMessage().contains("Illegal character"));
        }
    }
}