hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1143613 - in /hadoop/common/trunk/common: CHANGES.txt src/java/org/apache/hadoop/http/HttpServer.java src/test/core/org/apache/hadoop/http/TestHttpServer.java
Date Thu, 07 Jul 2011 00:14:10 GMT
Author: mattf
Date: Thu Jul  7 00:14:10 2011
New Revision: 1143613

URL: http://svn.apache.org/viewvc?rev=1143613&view=rev
Log:
HADOOP-7448. Merge from yahoo-merge branch -r 1079157 and -r 1079164: HttpServer /stacks servlet
should use plain text content type, without escaping. Contributed by Luke Lu.

Modified:
    hadoop/common/trunk/common/CHANGES.txt   (contents, props changed)
    hadoop/common/trunk/common/src/java/org/apache/hadoop/http/HttpServer.java
    hadoop/common/trunk/common/src/test/core/org/apache/hadoop/http/TestHttpServer.java

Modified: hadoop/common/trunk/common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/CHANGES.txt?rev=1143613&r1=1143612&r2=1143613&view=diff
==============================================================================
--- hadoop/common/trunk/common/CHANGES.txt (original)
+++ hadoop/common/trunk/common/CHANGES.txt Thu Jul  7 00:14:10 2011
@@ -358,6 +358,11 @@ Trunk (unreleased changes)
     HADOOP-7419. new hadoop-config.sh doesn't manage classpath for
     HADOOP_CONF_DIR correctly. (Bing Zheng and todd via todd)
 
+    HADOOP-7448. merge from yahoo-merge branch (via mattf):
+    -r 1079157: Fix content type for /stacks servlet to be 
+    plain text (Luke Lu)
+    -r 1079164: No need to escape plain text (Luke Lu)
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Propchange: hadoop/common/trunk/common/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jul  7 00:14:10 2011
@@ -1,4 +1,4 @@
-/hadoop/common/branches/yahoo-merge/CHANGES.txt:1079163
+/hadoop/common/branches/yahoo-merge/CHANGES.txt:1079157,1079163-1079164
 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226
 /hadoop/core/branches/branch-0.19/CHANGES.txt:713112
 /hadoop/core/trunk/CHANGES.txt:776175-785643,785929-786278

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/http/HttpServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/http/HttpServer.java?rev=1143613&r1=1143612&r2=1143613&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/http/HttpServer.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/http/HttpServer.java Thu Jul  7
00:14:10 2011
@@ -411,7 +411,7 @@ public class HttpServer implements Filte
     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 + ")");
   }
 
   /**
@@ -737,13 +737,12 @@ public class HttpServer implements Filte
     @Override
     public void doGet(HttpServletRequest request, HttpServletResponse response)
       throws ServletException, IOException {
-
+      response.setContentType("text/plain; charset=UTF-8");
       // Do the authorization
       if (!HttpServer.hasAdministratorAccess(getServletContext(), request,
           response)) {
         return;
       }
-
       PrintWriter out = response.getWriter();
       ReflectionUtils.printThreadInfo(out, "");
       out.close();

Modified: hadoop/common/trunk/common/src/test/core/org/apache/hadoop/http/TestHttpServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/test/core/org/apache/hadoop/http/TestHttpServer.java?rev=1143613&r1=1143612&r2=1143613&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/test/core/org/apache/hadoop/http/TestHttpServer.java (original)
+++ hadoop/common/trunk/common/src/test/core/org/apache/hadoop/http/TestHttpServer.java Thu
Jul  7 00:14:10 2011
@@ -61,6 +61,7 @@ import org.junit.Test;
 import org.mockito.Mockito;
 
 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;
@@ -136,6 +137,7 @@ public class TestHttpServer extends Http
     server.addServlet("htmlcontent", "/htmlcontent", HtmlContentServlet.class);
     server.start();
     baseUrl = getServerURL(server);
+    LOG.info("HTTP server started: "+ baseUrl);
   }
   
   @AfterClass public static void cleanup() throws Exception {
@@ -233,9 +235,6 @@ public class TestHttpServer extends Http
    * 
    */
   public static class DummyServletFilter implements Filter {
-
-    private static final Log LOG = LogFactory.getLog(
-        DummyServletFilter.class);
     @Override
     public void destroy() { }
 



Mime
View raw message