ASP.NET 5/Core/vNext CORS not working even if allowing pretty much everything
<p>I have a ASP.NET 5 Web API (Well, MVC now anyway) back-end which I am consuming in with the <a href="https://github.com/mzabriskie/axios" rel="noreferrer">axios</a> library in my JS app.</p>

<p>My CORS config in MVC is the following:</p>

<pre><code>public void ConfigureServices(IServiceCollection services)
{
      services.AddMvc();
      services.AddCors();
} 


public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{ 
      app.UseCors(builder =&gt; {
          builder.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader();
      });
}
</code></pre>

<p>So in other words, I should be allowing every request possible. However, while this fixed preflight requests, a POST requests still gets rejected (I can see it executes on the server, but there's no header in the response so it results in a client side error).</p>

<p>Does anyone have any ideas why this wouldn't work ?</p>

<p>These are the headers that are returned by the MVC api:</p>

<ul>
<li>For the OPTIONS preflight (this one passes):
<a href="https://i.stack.imgur.com/MPk80.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MPk80.png" alt="OPTIONS response"></a></li>
<li>For the actual POST request (this one does NOT pass):
<a href="https://i.stack.imgur.com/jxCLK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/jxCLK.png" alt="POST response"></a></li>
</ul>