28 lines
943 B
Java
28 lines
943 B
Java
package ba.steleks;
|
|
/**
|
|
* Created by admin on 06/05/2017.
|
|
*/
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
@Configuration
|
|
public class CrossOriginConfig {
|
|
|
|
// @Bean
|
|
// public FilterRegistrationBean corsFilter() {
|
|
// UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
|
// CorsConfiguration config = new CorsConfiguration();
|
|
// config.setAllowCredentials(true);
|
|
// config.addAllowedOrigin("*");
|
|
// config.addAllowedHeader("*");
|
|
// config.addAllowedMethod("OPTIONS");
|
|
// config.addAllowedMethod("GET");
|
|
// config.addAllowedMethod("POST");
|
|
// config.addAllowedMethod("PUT");
|
|
// config.addAllowedMethod("DELETE");
|
|
// source.registerCorsConfiguration("/**", config);
|
|
// FilterRegistrationBean bean = new FilterRegistrationBean(new CorsFilter(source));
|
|
// bean.setOrder(0);
|
|
// return bean;
|
|
// }
|
|
} |