title: Add 'access-control-allow-origin' response to options preflight request in Asp.NET
body: <p>I'm getting the following error in Chrome:</p>
  
  <blockquote>
    <p>Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin '<a href="http://localhost:9000">http://localhost:9000</a>' is therefore not allowed
    access.</p>
  </blockquote>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  {
      loggerFactory.AddConsole(Configuration.GetSection("Logging"));
      loggerFactory.AddDebug();
  
      app.UseIISPlatformHandler();
  
      app.UseDefaultFiles();
      app.UseStaticFiles();
  
      app.UseCors(policy =&gt; policy
         .WithOrigins("http://localhost:9000")
         .AllowAnyMethod()
         .WithHeaders("Access-Control-Allow-Origin, Content-Type, x-xsrf-token, Authorization")
         .AllowCredentials());
  
      app.UseMvc();
  }
  </code></pre>
  
  <p>According to chrome there is not a single header being added to the response.</p>
  
  <p>What is the correct way to add the <code>access-control-allow-origin</code> header to a options response in Asp.NET 5?</p>