title: Spring boot - cors not work
body: <p>I have my server running on localhost:8080 ( spring boot app ) and my frontend on localhost:3000 ( angular app ). The problem is that I want to make a request from frontend to my backend server. I am familiar with cors, but it doesn't work form me. I added this to my server :</p>
  
  <pre><code>    @Bean
  WebMvcConfigurer corsConfigurer() {
      return new WebMvcConfigurerAdapter() {
          @Override
          public void addCorsMappings(CorsRegistry registry) {
              registry.addMapping("/**").allowedOrigins("http://localhost:3000");
          }
      };
  }
  </code></pre>
  
  <p>, but I still get </p>
  
  <p>XMLHttpRequest cannot load <a href="http://localhost:8080/cars" rel="nofollow">http://localhost:8080/cars</a>. The request was redirected to '<a href="http://localhost:8080/login" rel="nofollow">http://localhost:8080/login</a>', which is disallowed for cross-origin requests that require preflight.</p>
  
  <p>What's wrong ?</p>