hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r712875 - in /hadoop/core/trunk: CHANGES.txt src/core/org/apache/hadoop/http/HttpServer.java src/test/org/apache/hadoop/http/TestServletFilter.java
Date Mon, 10 Nov 2008 23:44:00 GMT
Author: szetszwo
Date: Mon Nov 10 15:44:00 2008
New Revision: 712875

URL: http://svn.apache.org/viewvc?rev=712875&view=rev
Log:
HADOOP-4282. Some user facing URLs are not filtered by user filters. (szetszwo)

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/core/org/apache/hadoop/http/HttpServer.java
    hadoop/core/trunk/src/test/org/apache/hadoop/http/TestServletFilter.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=712875&r1=712874&r2=712875&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon Nov 10 15:44:00 2008
@@ -1077,6 +1077,9 @@
     to reflect the information being displayed. (Sreekanth Ramakrishnan via 
     yhemanth)
 
+    HADOOP-4282. Some user facing URLs are not filtered by user filters.
+    (szetszwo)
+
 Release 0.18.3 - Unreleased
 
   BUG FIXES

Modified: hadoop/core/trunk/src/core/org/apache/hadoop/http/HttpServer.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/core/org/apache/hadoop/http/HttpServer.java?rev=712875&r1=712874&r2=712875&view=diff
==============================================================================
--- hadoop/core/trunk/src/core/org/apache/hadoop/http/HttpServer.java (original)
+++ hadoop/core/trunk/src/core/org/apache/hadoop/http/HttpServer.java Mon Nov 10 15:44:00
2008
@@ -212,16 +212,15 @@
 
     final String[] USER_FACING_URLS = { "*.html", "*.jsp" };
     defineFilter(webAppContext, name, classname, parameters, USER_FACING_URLS);
+
+    final String[] ALL_URLS = { "/*" };
     for (Map.Entry<WebApplicationContext, Boolean> e : defaultContexts
         .entrySet()) {
       if (e.getValue()) {
         WebApplicationContext ctx = e.getKey();
-        defineFilter(ctx, name, classname, parameters, USER_FACING_URLS);
-        WebApplicationHandler handler = ctx.getWebApplicationHandler();
-        handler.addFilterPathMapping(ctx.getContextPath() + "/*", name,
-            Dispatcher.__ALL);
+        defineFilter(ctx, name, classname, parameters, ALL_URLS);
         LOG.info("Added filter " + name + " (class=" + classname
-            + ") to context path " + ctx.getContextPath() + "/*");
+            + ") to context " + ctx.getName());
       }
     }
     filterNames.add(name);

Modified: hadoop/core/trunk/src/test/org/apache/hadoop/http/TestServletFilter.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/test/org/apache/hadoop/http/TestServletFilter.java?rev=712875&r1=712874&r2=712875&view=diff
==============================================================================
--- hadoop/core/trunk/src/test/org/apache/hadoop/http/TestServletFilter.java (original)
+++ hadoop/core/trunk/src/test/org/apache/hadoop/http/TestServletFilter.java Mon Nov 10 15:44:00
2008
@@ -110,9 +110,12 @@
     final String fsckURL = "/fsck";
     final String stacksURL = "/stacks";
     final String ajspURL = "/a.jsp";
-    final String[] urls = {fsckURL, stacksURL, ajspURL};
+    final String logURL = "/logs/a.log";
+    final String hadooplogoURL = "/static/hadoop-logo.jpg";
+    
+    final String[] urls = {fsckURL, stacksURL, ajspURL, logURL, hadooplogoURL};
     final Random ran = new Random();
-    final int[] sequence = new int[20];
+    final int[] sequence = new int[50];
     final int[] counts = new int[urls.length]; 
 
     //generate a random sequence and update counts 
@@ -140,7 +143,8 @@
       if (counts[i] == 0) {
         assertFalse(COUNTS.containsKey(urls[i]));
       } else {
-        assertEquals(counts[i], COUNTS.remove(urls[i]).intValue());
+        assertEquals("url[" + i + "]=" + urls[i],
+            Integer.valueOf(counts[i]), COUNTS.remove(urls[i]));
       }
     }
     assertTrue(COUNTS.isEmpty());



Mime
View raw message