1
0
mirror of synced 2026-08-05 17:57:15 +00:00

Minor changes to make filter chain validation more robust with custom request matchers.

This commit is contained in:
Luke Taylor
2011-10-24 21:21:10 +01:00
parent f2786805e6
commit 44e2543015
4 changed files with 15 additions and 3 deletions
@@ -1,5 +1,7 @@
package org.springframework.security.web;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.web.util.RequestMatcher;
import javax.servlet.Filter;
@@ -14,6 +16,7 @@ import java.util.*;
* @since 3.1
*/
public final class DefaultSecurityFilterChain implements SecurityFilterChain {
private static final Log logger = LogFactory.getLog(DefaultSecurityFilterChain.class);
private final RequestMatcher requestMatcher;
private final List<Filter> filters;
@@ -22,6 +25,7 @@ public final class DefaultSecurityFilterChain implements SecurityFilterChain {
}
public DefaultSecurityFilterChain(RequestMatcher requestMatcher, List<Filter> filters) {
logger.info("Creating filter chain: " + requestMatcher + ", " + filters);
this.requestMatcher = requestMatcher;
this.filters = new ArrayList<Filter>(filters);
}
@@ -20,7 +20,6 @@ import org.apache.commons.logging.LogFactory;
import org.springframework.security.web.firewall.DefaultHttpFirewall;
import org.springframework.security.web.firewall.FirewalledRequest;
import org.springframework.security.web.firewall.HttpFirewall;
import org.springframework.security.web.util.AnyRequestMatcher;
import org.springframework.security.web.util.RequestMatcher;
import org.springframework.security.web.util.UrlUtils;
import org.springframework.web.filter.DelegatingFilterProxy;
@@ -92,6 +92,7 @@ public class FilterInvocation {
}
request.setContextPath(contextPath);
request.setServletPath(servletPath);
request.setRequestURI(contextPath + servletPath + (pathInfo == null ? "" : pathInfo));
request.setPathInfo(pathInfo);
request.setQueryString(query);
request.setMethod(method);