diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java index cbe72fb6368..d459eaef1e7 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java @@ -134,6 +134,18 @@ public class CorsRegistration { return this; } + /** + * Apply the given {@code CorsConfiguration} to the one being configured via + * {@link CorsConfiguration#combine(CorsConfiguration)} which in turn has been + * initialized with {@link CorsConfiguration#applyPermitDefaultValues()}. + * @param other the configuration to apply + * @since 5.3 + */ + public CorsRegistration combine(CorsConfiguration other) { + this.config.combine(other); + return this; + } + protected String getPathPattern() { return this.pathPattern; } diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java index 6a006387211..71542289803 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java @@ -135,6 +135,18 @@ public class CorsRegistration { return this; } + /** + * Apply the given {@code CorsConfiguration} to the one being configured via + * {@link CorsConfiguration#combine(CorsConfiguration)} which in turn has been + * initialized with {@link CorsConfiguration#applyPermitDefaultValues()}. + * @param other the configuration to apply + * @since 5.3 + */ + public CorsRegistration combine(CorsConfiguration other) { + this.config.combine(other); + return this; + } + protected String getPathPattern() { return this.pathPattern; }