Untitled

 avatar
unknown
plain_text
6 months ago
450 B
4
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