Untitled
unknown
plain_text
a year ago
450 B
7
Indexable
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Value("${cors.origins}")
private String corsOrigins;
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOriginPatterns(corsOrigins)
.allowedMethods("POST", "GET", "PUT", "PATCH", "OPTIONS", "DELETE")
.allowCredentials(true).maxAge(3600);
}
}Editor is loading...
Leave a Comment