diff --git a/itest/web/pom.xml b/itest/web/pom.xml index 57165655c1..390b978f34 100644 --- a/itest/web/pom.xml +++ b/itest/web/pom.xml @@ -24,6 +24,10 @@ 1.2 test + + org.springframework + spring-webmvc + org.mortbay.jetty jetty @@ -48,12 +52,5 @@ ${jetty.version} test - diff --git a/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java b/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java new file mode 100644 index 0000000000..a947ab6103 --- /dev/null +++ b/itest/web/src/main/java/org/springframework/security/itest/web/TestController.java @@ -0,0 +1,19 @@ +package org.springframework.security.itest.web; + +import java.io.IOException; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +@Controller +public class TestController { + + @RequestMapping(value="/secure/file?with?special?chars.htm", method=RequestMethod.GET) + public void sec1255TestUrl(HttpServletResponse response) throws IOException { + response.getWriter().append("I'm file?with?special?chars.htm"); + } + +} diff --git a/itest/web/src/main/webapp/WEB-INF/http-security.xml b/itest/web/src/main/webapp/WEB-INF/http-security.xml index 55a6d931d9..dd80adc4d7 100644 --- a/itest/web/src/main/webapp/WEB-INF/http-security.xml +++ b/itest/web/src/main/webapp/WEB-INF/http-security.xml @@ -24,13 +24,11 @@ - + - - diff --git a/itest/web/src/main/webapp/secure/file?with?special?chars.html b/itest/web/src/main/webapp/secure/file?with?special?chars.html deleted file mode 100644 index 68ac0a0302..0000000000 --- a/itest/web/src/main/webapp/secure/file?with?special?chars.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Special Chars File - - -

I'm file?with?special?chars.html

- - diff --git a/itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java b/itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java index 5294ae8e1e..ec420d866b 100644 --- a/itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java +++ b/itest/web/src/test/java/org/springframework/security/integration/AbstractWebServerIntegrationTests.java @@ -3,11 +3,13 @@ package org.springframework.security.integration; import org.springframework.web.context.ContextLoaderListener; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; +import org.springframework.web.servlet.DispatcherServlet; import org.springframework.util.StringUtils; import net.sourceforge.jwebunit.WebTester; import org.mortbay.jetty.Server; +import org.mortbay.jetty.servlet.ServletHolder; import org.mortbay.jetty.webapp.WebAppContext; import javax.servlet.ServletContext; @@ -64,6 +66,11 @@ public abstract class AbstractWebServerIntegrationTests { webCtx.getInitParams().put("contextConfigLocation", getContextConfigLocations()); } + ServletHolder servlet = new ServletHolder(); + servlet.setName("testapp"); + servlet.setClassName(DispatcherServlet.class.getName()); + webCtx.addServlet(servlet, "*.htm"); + return webCtx; } diff --git a/itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java b/itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java index d208805940..b2b5e76212 100644 --- a/itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java +++ b/itest/web/src/test/java/org/springframework/security/integration/InMemoryProviderWebAppTests.java @@ -42,9 +42,9 @@ public class InMemoryProviderWebAppTests extends AbstractWebServerIntegrationTes // SEC-1255 @Test public void redirectToUrlWithSpecialCharsInFilenameWorksOk() throws Exception { - beginAt("secure/file%3Fwith%3Fspecial%3Fchars.html?someArg=1"); + beginAt("secure/file%3Fwith%3Fspecial%3Fchars.htm?someArg=1"); login("jimi", "jimispassword"); - assertTextPresent("I'm file?with?special?chars.html"); + assertTextPresent("I'm file?with?special?chars.htm"); } }