diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java index f3411352ddb..fa0a59df8cd 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java @@ -285,9 +285,23 @@ public HttpSecurity headers(Customizer> headersC } /** - * Adds a {@link CorsFilter} to be used. If a bean by the name of corsFilter is - * provided, that {@link CorsFilter} is used. Else if corsConfigurationSource is - * defined, then that {@link CorsConfiguration} is used. You can enable CORS using: + * Configures Cross-Origin Resource Sharing (CORS). + * + *

A {@link CorsFilter} is added to the security filter chain in either of + * the following cases: + *

+ * + *

Invoke this method when you need to customize the {@link CorsConfigurer}, + * for example to use a {@link CorsFilter} or a + * {@link org.springframework.web.cors.CorsConfigurationSource} bean with a + * different name: * *

 	 * @Configuration