Spring-Boot 2.1.2:
, . "Access-Control-Allow-Origin". CorsFilter, Spring.
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.addAllowedOrigin("http://127.0.0.1:4200");
config.addAllowedOrigin("http://localhost:4200");
config.addAllowedHeader("*");
config.setAllowedMethods(Arrays.asList("OPTIONS", "GET"));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/actuator/**", config);
return new CorsFilter(source);
}
CorsFilter - , . - , "//**". .

() , "Access-Control-Allow-Origin" . , (, @CrossOrigin - - MVC, CorsFilter).
/:

You can also create your own filter that adds a header to the http-response. I think it's better to use the standard approach, but in some cases debugging it may be useful to know that by adding a line to your filter, you can add what you want.
response.addHeader("Access-Control-Allow-Origin", "*");
Please note that the above does not contain the conditional check proposed earlier.
Hope this helps. Hurrah
source
share