title: Add a header to all responses in ASP.NET Core MVC
body: <p>I would like to know how I can add <code>Access-Control-Allow-Origin:*</code> to my headers.</p>
  
  <p>I've tried this unsuccessfully:</p>
  
  <pre><code>app.Use((context, next) =&gt;
  {
      context.Response.Headers.Add("Access-Control-Allow-Origin", new[] { "*" });
      return next.Invoke();
  });
  </code></pre>