Browse Source

Polish CorsConfigurationSource Selection Logic

Issue gh-16501
pull/16717/head
Josh Cummings 10 months ago
parent
commit
e65e32bb42
No known key found for this signature in database
GPG Key ID: 869B37A20E876129
  1. 2
      config/src/main/java/org/springframework/security/config/annotation/web/configurers/CorsConfigurer.java

2
config/src/main/java/org/springframework/security/config/annotation/web/configurers/CorsConfigurer.java

@ -107,7 +107,7 @@ public class CorsConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHt @@ -107,7 +107,7 @@ public class CorsConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHt
* @return
*/
private static CorsFilter getMvcCorsFilter(ApplicationContext context) {
if (context.getBeanNamesForType(CorsConfigurationSource.class).length > 0) {
if (context.containsBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) {
CorsConfigurationSource corsConfigurationSource = context
.getBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME, CorsConfigurationSource.class);
return new CorsFilter(corsConfigurationSource);

Loading…
Cancel
Save