title: .NET Core - CORS error even after enabling CORS
body: <p>I am trying to call the WebAPI method to get some data, but it throws a <code>Cross-Origin Read Blocking (CORB) blocked cross-origin response https://localhost:44332/api/Controller/Action with MIME type text/html.</code> even though I have enabled CORS in my ConfigureServices Method and used the policy in the Configure method in the startup</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
          {
  
              services.AddCors(options =&gt;
              {
                  options.AddPolicy("AllowAll",
                      builder =&gt;
                      {
                          builder
                              .WithOrigins("http://localhost:4200/")
                              .AllowAnyMethod()
                              .AllowAnyHeader()
                              .AllowCredentials();
                      });
              });
  
              services.AddMvc();
          }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              .....
              app.UseCors("AllowAll");
              app.UseHttpsRedirection();
              app.UseStaticFiles();
              app.UseCookiePolicy();
              app.UseMvc(routes =&gt;
              {
                  routes.MapRoute(
                      name: "default",
                      template: "{controller=Home}/{action=Index}/{id?}");
              });
  
  
  }
  </code></pre>
  
  <p>What could the reason be?</p>