@Test
  public void testContentTypes() throws Exception {
    // Static CSS files should have text/css
    URL cssUrl = new URL(baseUrl, "/static/test.css");
    HttpURLConnection conn = (HttpURLConnection) cssUrl.openConnection();
    conn.connect();
    assertEquals(200, conn.getResponseCode());
    assertEquals("text/css", conn.getContentType());

    // Servlets should have text/plain with proper encoding by default
    URL servletUrl = new URL(baseUrl, "/echo?a=b");
    conn = (HttpURLConnection) servletUrl.openConnection();
    conn.connect();
    assertEquals(200, conn.getResponseCode());
    assertEquals("text/plain;charset=utf-8", conn.getContentType());

    // We should ignore parameters for mime types - ie a parameter
    // ending in .css should not change mime type
    servletUrl = new URL(baseUrl, "/echo?a=b.css");
    conn = (HttpURLConnection) servletUrl.openConnection();
    conn.connect();
    assertEquals(200, conn.getResponseCode());
    assertEquals("text/plain;charset=utf-8", conn.getContentType());

    // Servlets that specify text/html should get that content type
    servletUrl = new URL(baseUrl, "/htmlcontent");
    conn = (HttpURLConnection) servletUrl.openConnection();
    conn.connect();
    assertEquals(200, conn.getResponseCode());
    assertEquals("text/html;charset=utf-8", conn.getContentType());

    // JSPs should default to text/html with utf8
    // JSPs do not work from unit tests
    // servletUrl = new URL(baseUrl, "/testjsp.jsp");
    // conn = (HttpURLConnection)servletUrl.openConnection();
    // conn.connect();
    // assertEquals(200, conn.getResponseCode());
    // assertEquals("text/html; charset=utf-8", conn.getContentType());
  }
Test that verifies headers can be up to 64K long. The test adds a 63K header leaving 1K for
other headers. This is because the header buffer setting is for ALL headers, names and values
included.
hbase-http/src/test/java/org/apache/hadoop/hbase/http/TestHttpServer.java