Browse Source

Expose combine method in CorsConfiguration

Closes gh-25716
pull/25823/head
Rossen Stoyanchev 6 years ago
parent
commit
b9ef5416b9
  1. 12
      spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java
  2. 12
      spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java

12
spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java

@ -134,6 +134,18 @@ public class CorsRegistration { @@ -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;
}

12
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java

@ -135,6 +135,18 @@ public class CorsRegistration { @@ -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;
}

Loading…
Cancel
Save