Add a check of the edge cases for bug 49488. As expected, they all pass.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 25 Jun 2010 07:58:14 +0000 (07:58 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 25 Jun 2010 07:58:14 +0000 (07:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@957833 13f79535-47bb-0310-9956-ffa450edef68

test/org/apache/catalina/util/TestRequestUtil.java

index 51ea934..8633d93 100644 (file)
@@ -21,6 +21,13 @@ import junit.framework.TestCase;
 
 public class TestRequestUtil extends TestCase {
 
+    public void testNormalizeString() {
+        assertEquals("/something",RequestUtil.normalize("//something"));
+        assertEquals("/some/thing",RequestUtil.normalize("some//thing"));
+        assertEquals("/something/",RequestUtil.normalize("something//"));
+        assertEquals("/",RequestUtil.normalize("//"));
+    }
+
     public void testURLDecodeString() {
         // %n rather than %nn should throw an IAE according to the Javadoc
         Exception exception = null;