use of cn.taketoday.web.servlet.filter.CorsFilter in project today-infrastructure by TAKETODAY.
the class CorsFilterTests method setup.
@BeforeEach
public void setup() {
config.setAllowedOrigins(Arrays.asList("https://domain1.com", "https://domain2.com"));
config.setAllowedMethods(Arrays.asList("GET", "POST"));
config.setAllowedHeaders(Arrays.asList("header1", "header2"));
config.setExposedHeaders(Arrays.asList("header3", "header4"));
config.setMaxAge(123L);
config.setAllowCredentials(false);
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
filter = new CorsFilter(configSource);
}
use of cn.taketoday.web.servlet.filter.CorsFilter in project today-framework by TAKETODAY.
the class CorsFilterTests method setup.
@BeforeEach
public void setup() {
config.setAllowedOrigins(Arrays.asList("https://domain1.com", "https://domain2.com"));
config.setAllowedMethods(Arrays.asList("GET", "POST"));
config.setAllowedHeaders(Arrays.asList("header1", "header2"));
config.setExposedHeaders(Arrays.asList("header3", "header4"));
config.setMaxAge(123L);
config.setAllowCredentials(false);
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
filter = new CorsFilter(configSource);
}
Aggregations