title: CORS headers not on response when hitting endpoint from PostMan
body: <p>I have a ASP.net Web API that is using .NET 5</p>
  <p>I am trying to configure CORS using the Microsoft documentation (<a href="https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-5.0" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-5.0</a>)</p>
  <p>From what I understand in the documentation I don't need to add anything onto my controller as this should configure CORS globally. The controller is inheriting from Controller</p>
  <p>When I hit my endpoint in PostMan I do not get any CORS headers coming back. Spent a good few days trying to troubleshoot this one so any help is appreciated.</p>
  <p>Startup.cs</p>
  <pre><code>public class Startup
  {
      public Startup(IConfiguration configuration)
      {
          Configuration = configuration;
      }
  
      public IConfiguration Configuration { get; }
  
      // This method gets called by the runtime. Use this method to add services to the container.
      public void ConfigureServices(IServiceCollection services)
      {
          services.Configure&lt;ConnectionStrings&gt;(Configuration.GetSection(&quot;ConnectionStrings&quot;));
  
          services.AddCors(options =&gt;
          {
              options.AddPolicy(name: &quot;defaultPolicy&quot;,
                                builder =&gt;
                                {
                                    builder.AllowAnyOrigin()
                                           .AllowAnyMethod()
                                           .WithHeaders(&quot;Content-Type&quot;, &quot;Accept&quot;, &quot;Referer&quot;, &quot;Authorization&quot;, &quot;Sec-Fetch-Mode&quot;, &quot;User-Agent&quot;);
                                });
          });
  
          services.AddControllers().AddNewtonsoftJson();
  
          services.AddTransient&lt;IModelRepository, ModelRepository&gt;();
  
          services.AddTransient&lt;IModelService, ModelService&gt;();
  
          services.AddSwaggerGen(c =&gt;
          {
              c.SwaggerDoc(&quot;v1&quot;, new OpenApiInfo { Title = &quot;RecommendationsAPI&quot;, Version = &quot;v1&quot; });
          });
      }
  
      // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
      public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
  
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
              app.UseSwagger();
              app.UseSwaggerUI(c =&gt; c.SwaggerEndpoint(&quot;/swagger/v1/swagger.json&quot;, &quot;RecommendationsAPI v1&quot;));
          }
  
  
          app.UseHttpsRedirection();
  
          app.UseRouting();
  
          app.UseCors(&quot;defaultPolicy&quot;);
  
          app.UseAuthorization();
  
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapControllers();
          });
      }
  }
  </code></pre>
  <p>PostMan request and response
  <a href="https://i.stack.imgur.com/dUQT4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dUQT4.png" alt="enter image description here" /></a></p>