title: .net core cors with multiple origins and multiple headers
body: <p>I have different origins with different headers need to be allowed via cors policies.</p>
  
  <blockquote>
    <p>For example:</p>
  </blockquote>
  
  <p>1/
   - Origin: abc.com
   - Headers: A, B</p>
  
  <p>2/
   - Origin: bcd.com
   - Headers: A, C</p>
  
  <blockquote>
    <p>This is my code:</p>
  </blockquote>
  
  <pre><code>services.AddCors(opt =&gt;
              {
                  opt.AddPolicy(
                      "ABC",
                      builder =&gt;
                      {
                        builder.WithOrigins("abc.com")
                            .WithHeaders("A", "B");
                      });
          opt.AddPolicy(
                      "BCD",
                      builder =&gt;
                      {
                        builder.WithOrigins("bcd.com")
                            .WithHeaders("A", "C");
                      });
          });
  </code></pre>
  
  <blockquote>
    <p>and in Startup.Configure:   </p>
  </blockquote>
  
  <pre><code>builder.UseCors("ABC");
  builder.UseCors("BCD");
  </code></pre>
  
  <p>Everything about the origin working ok, but the issue is about the headers. The headers are only worked for the first policy. In the code above, the headers working ok with Policy ABC. I can send the request with header A or header B as expected but for policy BCD, if I send a request with no headers. It worked but if I send a request with header A or C, it not works.</p>
  
  <p>And if I move BCD on top of ABC, BCD headers works ok.</p>