Minor changes to make filter chain validation more robust with custom request matchers.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user