JujaLabs / juja-platform

0 stars 7 forks source link

Add CORS filter #54

Closed petrokramar closed 6 years ago

petrokramar commented 6 years ago

@Bean public FilterRegistrationBean corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = new CorsConfiguration(); config.setAllowCredentials(true); config.addAllowedOrigin(""); config.addAllowedHeader(""); config.addAllowedMethod("*"); source.registerCorsConfiguration("/**", config); FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source)); bean.setOrder(0); return bean; }

danilkuznetsov commented 6 years ago

I think these settings should be in spring profile like dev.