mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-24 13:02:13 +00:00
Polish CorsConfigurationSource Selection Logic
Issue gh-16501
This commit is contained in:
parent
1618963255
commit
e65e32bb42
@ -107,7 +107,7 @@ public class CorsConfigurer<H extends HttpSecurityBuilder<H>> extends AbstractHt
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private static CorsFilter getMvcCorsFilter(ApplicationContext context) {
|
private static CorsFilter getMvcCorsFilter(ApplicationContext context) {
|
||||||
if (context.getBeanNamesForType(CorsConfigurationSource.class).length > 0) {
|
if (context.containsBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME)) {
|
||||||
CorsConfigurationSource corsConfigurationSource = context
|
CorsConfigurationSource corsConfigurationSource = context
|
||||||
.getBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME, CorsConfigurationSource.class);
|
.getBean(HANDLER_MAPPING_INTROSPECTOR_BEAN_NAME, CorsConfigurationSource.class);
|
||||||
return new CorsFilter(corsConfigurationSource);
|
return new CorsFilter(corsConfigurationSource);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user