added multiple slash test:
authormaxcooper <maxcooper>
Tue, 10 Jun 2003 11:40:41 +0000 (11:40 +0000)
committermaxcooper <maxcooper>
Tue, 10 Jun 2003 11:40:41 +0000 (11:40 +0000)
//securePage.jsp

src/test/org/securityfilter/test/http/form/PathTricksTest.java

index 984fa30..47a89fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * $Header: /cvsroot/securityfilter/securityfilter/src/test/org/securityfilter/test/http/form/PathTricksTest.java,v 1.1 2003/06/10 11:37:06 maxcooper Exp $
- * $Revision: 1.1 $
- * $Date: 2003/06/10 11:37:06 $
+ * $Header: /cvsroot/securityfilter/securityfilter/src/test/org/securityfilter/test/http/form/PathTricksTest.java,v 1.2 2003/06/10 11:40:41 maxcooper Exp $
+ * $Revision: 1.2 $
+ * $Date: 2003/06/10 11:40:41 $
  *
  * ====================================================================
  * The SecurityFilter Software License, Version 1.1
@@ -65,7 +65,7 @@ import org.securityfilter.test.http.TestBase;
  * /public/../securePage.jsp
  *
  * @author Max Cooper (max@maxcooper.com)
- * @version $Revision: 1.1 $ $Date: 2003/06/10 11:37:06 $
+ * @version $Revision: 1.2 $ $Date: 2003/06/10 11:40:41 $
  */
 public class PathTricksTest extends TestBase {
    /**
@@ -112,4 +112,22 @@ public class PathTricksTest extends TestBase {
          title
       );
    }
+
+   /**
+    * Test that the user is asked to login before accessing //securePage.jsp.
+    *
+    * @throws Exception
+    */
+   public void testMultipleSlashURLTrick() throws Exception {
+      // request the secure page and login
+      WebResponse response = performJustInTimeLogin("//securePage.jsp");
+
+      // make sure the response leads to the secure page
+      String title = response.getTitle();
+      assertEquals(
+         "Expected secure page, got:" + title,
+         Constants.SECURE_TITLE,
+         title
+      );
+   }
 }