adnanrahin / Movie-Application

A full-stack Application Development, Using Java, Angular, MySQL, Hibernate, Spring-Boot, RestAPI.
6 stars 4 forks source link

access control allow origin #2

Closed adnanrahin closed 3 years ago

adnanrahin commented 3 years ago

`@EnableWebSecurity @Configuration public class RestDataConfig extends WebSecurityConfigurerAdapter {

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors();
}

@Bean
CorsConfigurationSource corsConfigurationSource() {
    UrlBasedCorsConfigurationSource source = new
            UrlBasedCorsConfigurationSource();
    source.registerCorsConfiguration("/**", new CorsConfiguration().applyPermitDefaultValues());
    return source;
}

} `