Skip to content

Commit e65e32b

Browse files
committed
Polish CorsConfigurationSource Selection Logic
Issue gh-16501
1 parent 1618963 commit e65e32b

File tree

1 file changed

+1
-1
lines changed
  • config/src/main/java/org/springframework/security/config/annotation/web/configurers

1 file changed

+1
-1
lines changed

Diff for: config/src/main/java/org/springframework/security/config/annotation/web/configurers/CorsConfigurer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static class MvcCorsFilter {
107107
* @return
108108
*/
109109
private static CorsFilter getMvcCorsFilter(ApplicationContext context) {
110-
if (context.getBeanNamesForType(CorsConfigurationSource.class).length > 0) {
110+
if (context.containsBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) {
111111
CorsConfigurationSource corsConfigurationSource = context
112112
.getBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME, CorsConfigurationSource.class);
113113
return new CorsFilter(corsConfigurationSource);

0 commit comments

Comments
 (0)