title: Setting cors headers in Azure function
body: <p>In my Azure function, I try to set cors headers:</p>
  
  <pre><code>var response = req.CreateResponse(HttpStatusCode.OK);
  response.Content = new ObjectContent&lt;List&lt;RecordEntity&gt;&gt;(data, new JsonMediaTypeFormatter(), "application/json");
  
  response.Headers.Add("Access-Control-Allow-Origin", "*");
  response.Headers.Add("Access-Control-Allow-Methods", "GET, POST, PUT");
  response.Headers.Add("Access-Control-Allow-Headers", "*");
  response.Headers.Add("Access-Control-Allow-Credentials", "true");
  
  return response;
  </code></pre>
  
  <p>However, none of these headers get to the client in the http response, they are stripped from the response.</p>
  
  <p>I suppose there is some other way of setting the cors headers, but cannot find how it works.</p>