@Configuration
open classCorsConfig {
private funbuildConfig(): CorsConfiguration {
valconfig = CorsConfiguration()
config.allowedOrigins=listOf("*")
config.allowedHeaders=listOf("*")
config.allowedMethods=listOf("*")
returnconfig
}
@Bean
open funcorsFilter(): CorsFilter {
valsource = UrlBasedCorsConfigurationSource()
source.registerCorsConfiguration("/**", buildConfig())
returnCorsFilter(source)
}
}