You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jb...@apache.org on 2007/05/06 22:00:39 UTC

svn commit: r535650 - in /incubator/wicket/trunk: jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/ jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/

Author: jbq
Date: Sun May  6 13:00:38 2007
New Revision: 535650

URL: http://svn.apache.org/viewvc?view=rev&rev=535650
Log:
WICKET-40 Parameters of nice URL's pages with 'sensitive' characters

Changes the way WicketFilter computes the relative URL by avoiding by any means
calling getPathInfo(), only using getRequestURI(), getContextPath() and
getServletPath(), as getPathInfo() decodes the URL thus breaking slash-delimited
parameters

Modified:
    incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
    incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java
    incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java

Modified: incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java?view=diff&rev=535650&r1=535649&r2=535650
==============================================================================
--- incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java (original)
+++ incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/WicketFilter.java Sun May  6 13:00:38 2007
@@ -288,15 +288,13 @@
 	 */
 	public String getRelativePath(HttpServletRequest request)
 	{
-		String path = request.getServletPath();
+		String path = request.getRequestURI();
+		String contextPath = request.getContextPath();
+		path = path.substring(contextPath.length());
 		if (servletMode)
 		{
-			path = request.getPathInfo();
-			// No path info => root.
-			if (path == null)
-			{
-				path = "";
-			}
+			String servletPath = request.getServletPath();
+			path = path.substring(servletPath.length());
 		}
 		filterPath = getFilterPath(request);
 

Modified: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java?view=diff&rev=535650&r1=535649&r2=535650
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java (original)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithFPTest.java Sun May  6 13:00:38 2007
@@ -74,7 +74,7 @@
 		assertTitleEquals("Wicket Examples - helloworld");
 		assertTextInElement("message", "Message is: 'Test'");
 	}
-	public void bugTestWithSlash() throws Exception
+	public void testWithSlash() throws Exception
 	{
 		beginAt("/filtertest/hello/message/Test%2FWith%20a%20Slash");
 		dumpHtml();

Modified: incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java
URL: http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java?view=diff&rev=535650&r1=535649&r2=535650
==============================================================================
--- incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java (original)
+++ incubator/wicket/trunk/jdk-1.5/wicket-examples/src/test/java/org/apache/wicket/filtertest/WithoutCPWithoutFPTest.java Sun May  6 13:00:38 2007
@@ -74,7 +74,7 @@
 		assertTitleEquals("Wicket Examples - helloworld");
 		assertTextInElement("message", "Message is: 'Test'");
 	}
-	public void bugTestWithSlash() throws Exception
+	public void testWithSlash() throws Exception
 	{
 		beginAt("/hello/message/Test%2FWith%20a%20Slash");
 		dumpHtml();