Spring Boot CORS filter - CORS preflight channel did not succeed
<p>I need to add CORS filter to my Spring Boot web application.</p>

<p>I have added CORS mappings as described in the following documentation <a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/cors.html" rel="noreferrer">http://docs.spring.io/spring/docs/current/spring-framework-reference/html/cors.html</a> </p>

<p>This is my config:</p>

<pre><code>@Configuration
@EnableWebMvc
public class WebMvcConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        // @formatter:off   
        registry
            .addMapping("/**")
            .allowedOrigins(CrossOrigin.DEFAULT_ORIGINS)
            .allowedHeaders(CrossOrigin.DEFAULT_ALLOWED_HEADERS)
            .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
            .maxAge(3600L);
        // @formatter:on
    }

...

}
</code></pre>

<p>Right now when I'm trying to access my API I receiving a following error:</p>

<pre><code>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://example.com/api/v1.0/user. (Reason: CORS preflight channel did not succeed).
</code></pre>

<p>This is a screenshot from FF console:</p>

<p><a href="https://i.stack.imgur.com/XpJBL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/XpJBL.png" alt="enter image description here"></a></p>

<p>What am I doing wrong and how to properly configure CORS headers in order to avoid this issue ? </p>