Skip to content

Commit 3b4ee1f

Browse files
committed
Removed isServlet30 check
1 parent b838f7c commit 3b4ee1f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/AbstractRequestMatcherRegistry.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.springframework.security.web.util.matcher.AnyRequestMatcher;
2626
import org.springframework.security.web.util.matcher.RegexRequestMatcher;
2727
import org.springframework.security.web.util.matcher.RequestMatcher;
28-
import org.springframework.util.ClassUtils;
2928
import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
3029

3130
import java.util.ArrayList;
@@ -161,7 +160,7 @@ public C antMatchers(String... antPatterns) {
161160
*/
162161
protected final List<MvcRequestMatcher> createMvcMatchers(HttpMethod method,
163162
String... mvcPatterns) {
164-
boolean isServlet30 = ClassUtils.isPresent("javax.servlet.ServletRegistration", getClass().getClassLoader());
163+
165164
ObjectPostProcessor<Object> opp = this.context.getBean(ObjectPostProcessor.class);
166165
if (!this.context.containsBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) {
167166
throw new NoSuchBeanDefinitionException("A Bean named " + HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME +" of type " + HandlerMappingIntrospector.class.getName()
@@ -173,9 +172,8 @@ protected final List<MvcRequestMatcher> createMvcMatchers(HttpMethod method,
173172
mvcPatterns.length);
174173
for (String mvcPattern : mvcPatterns) {
175174
MvcRequestMatcher matcher = new MvcRequestMatcher(introspector, mvcPattern);
176-
if (isServlet30) {
177-
opp.postProcess(matcher);
178-
}
175+
opp.postProcess(matcher);
176+
179177
if (method != null) {
180178
matcher.setMethod(method);
181179
}

0 commit comments

Comments
 (0)