-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
I'm trying to use your RegexCorsConfiguration I have kind of the same implementation as you except I expose CorsFilter using a FilterRegistrationBean and via @Bean annotation.
@Bean
FilterRegistrationBean corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
CorsConfiguration config = new RegexCorsConfiguration();
config.setAllowCredentials(true);
this.corsSettings.getAllowedHeaders().forEach(config::addAllowedHeader);
this.corsSettings.getAllowedMethods().forEach(config::addAllowedMethod);
this.corsSettings.getAllowedOrigins().forEach(config::addAllowedOrigin);
source.registerCorsConfiguration("/**", config);
FilterRegistrationBean bean = new FilterRegistrationBean<>(new CorsFilter(source));
bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
return bean;
}
But for some reason, it always calls the superclass implementation of the checkOrigin method. Do you have any idea about this? Appreciate your feedback
Metadata
Metadata
Assignees
Labels
No labels