FilterInvocation should set queryString on dummy request.

This commit is contained in:
Luke Taylor 2010-10-03 22:54:21 +01:00
parent f455e9a5a4
commit a6d47203db
1 changed files with 4 additions and 3 deletions

View File

@ -49,6 +49,7 @@ import org.springframework.security.web.util.UrlUtils;
* *
* @author Ben Alex * @author Ben Alex
* @author colin sampaleanu * @author colin sampaleanu
* @author Luke Taylor
*/ */
public class FilterInvocation { public class FilterInvocation {
//~ Static fields ================================================================================================== //~ Static fields ==================================================================================================
@ -58,8 +59,6 @@ public class FilterInvocation {
} }
}; };
static final HttpServletResponse DUMMY_RESPONSE = new DummyResponse();
//~ Instance fields ================================================================================================ //~ Instance fields ================================================================================================
private FilterChain chain; private FilterChain chain;
@ -94,6 +93,7 @@ public class FilterInvocation {
request.setContextPath(contextPath); request.setContextPath(contextPath);
request.setServletPath(servletPath); request.setServletPath(servletPath);
request.setPathInfo(pathInfo); request.setPathInfo(pathInfo);
request.setQueryString(query);
request.setMethod(method); request.setMethod(method);
this.request = request; this.request = request;
} }
@ -146,7 +146,7 @@ public class FilterInvocation {
} }
} }
@SuppressWarnings("unchecked") @SuppressWarnings({"unchecked", "deprecation"})
class DummyRequest implements HttpServletRequest { class DummyRequest implements HttpServletRequest {
private String requestURI; private String requestURI;
private String contextPath = ""; private String contextPath = "";
@ -398,6 +398,7 @@ class DummyRequest implements HttpServletRequest {
} }
} }
@SuppressWarnings({"deprecation"})
class DummyResponse implements HttpServletResponse { class DummyResponse implements HttpServletResponse {
public void addCookie(Cookie cookie) { public void addCookie(Cookie cookie) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();