Remove deprecated AbstractHandlerMapping#getCorsConfigurations

Closes gh-22719
master
Sebastien Deleuze 6 years ago
parent d27b5d0ab6
commit eb75367934
  1. 16
      spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMapping.java

@ -230,22 +230,6 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
this.corsConfigurationSource = corsConfigurationSource;
}
/**
* Get the "global" CORS configurations.
* @deprecated as of 5.1 since it is now possible to set a {@link CorsConfigurationSource} which is not a
* {@link UrlBasedCorsConfigurationSource}. Expected to be removed in 5.2.
*/
@Deprecated
public Map<String, CorsConfiguration> getCorsConfigurations() {
if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) {
return ((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).getCorsConfigurations();
}
else {
throw new IllegalStateException("No CORS configurations available when the source " +
"is not an UrlBasedCorsConfigurationSource");
}
}
/**
* Configure a custom {@link CorsProcessor} to use to apply the matched
* {@link CorsConfiguration} for a request.

Loading…
Cancel
Save