title: Cors blocks my request even after enabling it in config
body: <p>Hey I am building a web site in react and I tried fetching data from my backend server built in spring but It won't work. I added CorsConfigurationSource to my security config yet it still doesnt work.
  My cors security config:</p>
  <pre><code>@Bean
  CorsConfigurationSource corsConfigurationSource(){
       CorsConfiguration corsConfiguration=new CorsConfiguration();
       corsConfiguration.setAllowedOrigins(Arrays.asList(&quot;http://localhost:3000&quot;));
       corsConfiguration.setAllowCredentials(true);
       corsConfiguration.setAllowedMethods(Arrays.asList(&quot;GET&quot;,&quot;POST&quot;));
       UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
       source.registerCorsConfiguration(&quot;/**&quot;, corsConfiguration);
       return source;
  }
  </code></pre>
  <p>The error that I end up getting: <a href="https://i.stack.imgur.com/olGCD.png%5C" rel="nofollow noreferrer">https://i.stack.imgur.com/olGCD.png\</a>
  My fetch request (I am posting user credentials):</p>
  <pre><code>fetch(&quot;http://localhost:8080/login&quot;, {
        method: &quot;POST&quot;,
        mode:'cors',
        headers: {
          &quot;Content-Type&quot;: &quot;application/x-www-form-urlencoded&quot;
        },
        body: new URLSearchParams(tempLoginCredentials),
      })
  </code></pre>