Skip to content

Commit

Permalink
Removed isServlet30 check
Browse files Browse the repository at this point in the history
  • Loading branch information
farooqkhan003 committed Jan 3, 2019
1 parent b838f7c commit 3b4ee1f
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.springframework.security.web.util.matcher.AnyRequestMatcher;
import org.springframework.security.web.util.matcher.RegexRequestMatcher;
import org.springframework.security.web.util.matcher.RequestMatcher;
import org.springframework.util.ClassUtils;
import org.springframework.web.servlet.handler.HandlerMappingIntrospector;

import java.util.ArrayList;
Expand Down Expand Up @@ -161,7 +160,7 @@ public C antMatchers(String... antPatterns) {
*/
protected final List<MvcRequestMatcher> createMvcMatchers(HttpMethod method,
String... mvcPatterns) {
boolean isServlet30 = ClassUtils.isPresent("javax.servlet.ServletRegistration", getClass().getClassLoader());

ObjectPostProcessor<Object> opp = this.context.getBean(ObjectPostProcessor.class);
if (!this.context.containsBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) {
throw new NoSuchBeanDefinitionException("A Bean named " + HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME +" of type " + HandlerMappingIntrospector.class.getName()
Expand All @@ -173,9 +172,8 @@ protected final List<MvcRequestMatcher> createMvcMatchers(HttpMethod method,
mvcPatterns.length);
for (String mvcPattern : mvcPatterns) {
MvcRequestMatcher matcher = new MvcRequestMatcher(introspector, mvcPattern);
if (isServlet30) {
opp.postProcess(matcher);
}
opp.postProcess(matcher);

if (method != null) {
matcher.setMethod(method);
}
Expand Down

0 comments on commit 3b4ee1f

Please sign in to comment.