Przeglądaj źródła

commit 079d1c4270ae6c652726b06956395df40b25ccf9
Author: Luke Lu <llu@yahoo-inc.com>
Date: Thu Dec 23 18:46:39 2010 -0800

Fix content type for /stacks servlet


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/yahoo-merge@1079157 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 lat temu
rodzic
commit
e2429b1352

+ 2 - 1
src/java/org/apache/hadoop/http/HttpServer.java

@@ -406,7 +406,7 @@ public class HttpServer implements FilterContainer {
     for (Context ctx : defaultContexts.keySet()) {
       defineFilter(ctx, name, classname, parameters, ALL_URLS);
     }
-    LOG.info("Added global filter" + name + " (class=" + classname + ")");
+    LOG.info("Added global filter '" + name + "' (class=" + classname + ")");
   }
 
   /**
@@ -738,6 +738,7 @@ public class HttpServer implements FilterContainer {
           response)) {
         return;
       }
+      response.setContentType("text/plain; charset=utf-8");
 
       PrintWriter out = new PrintWriter
                     (HtmlQuoting.quoteOutputStream(response.getOutputStream()));

+ 2 - 3
src/test/core/org/apache/hadoop/http/TestHttpServer.java

@@ -56,6 +56,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class TestHttpServer extends HttpServerFunctionalTest {
+  static final Log LOG = LogFactory.getLog(TestHttpServer.class);
   private static HttpServer server;
   private static URL baseUrl;
   private static final int MAX_THREADS = 10;
@@ -116,6 +117,7 @@ public class TestHttpServer extends HttpServerFunctionalTest {
     server.addServlet("echomap", "/echomap", EchoMapServlet.class);
     server.start();
     baseUrl = getServerURL(server);
+    LOG.info("HTTP server started: "+ baseUrl);
   }
   
   @AfterClass public static void cleanup() throws Exception {
@@ -199,9 +201,6 @@ public class TestHttpServer extends HttpServerFunctionalTest {
    * 
    */
   public static class DummyServletFilter implements Filter {
-
-    private static final Log LOG = LogFactory.getLog(
-        DummyServletFilter.class);
     @Override
     public void destroy() { }