1@Override
2public void addCorsMappings(CorsRegistry registry) {
3 registry.addMapping("/api/**")
4 .allowedOrigins("http://domain2.com")
5 .allowedMethods("PUT", "DELETE")
6 .allowedHeaders("header1", "header2", "header3")
7 .exposedHeaders("header1", "header2")
8 .allowCredentials(false).maxAge(3600);
9}Copied