title: Enable CORS in Umbraco 6 / Web API 2 Instance
body: <p>I'm a newer developer who has been developing a RESTful API with Web API 2 within an instance of Umbraco 6.  After some research on <a href="http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api" rel="nofollow">http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api</a>, I added the attribute to my controller as such:</p>
  
  <pre><code>[EnableCors(origins: "http://example.com,http://example.local", headers: "*", methods: "*")] //CORS TESTING
  public class PropertiesController : UmbracoApiController
  {
    //Code Hidden
  }
  </code></pre>
  
  <p>I'm finding that I can go to a site like <a href="http://codebeautify.org/jsonvalidate" rel="nofollow">http://codebeautify.org/jsonvalidate</a> and pull in my JSON through the endpoint URL and validate it even though I didn't allow that host to call my API.</p>
  
  <p>Following the instructions from the asp.net link above, I noticed that my solution doesn't have an "App_Start" folder with a WebApiConfig.CS file, so I was never able to add the <code>config.EnableCors();</code> code which I think may be the underlying issue?  I'm not sure how to continue at this point because to get this far, I just had to add a new <code>Web API Controller Class</code> to '/App_Code' and then inherit <code>UmbracoApiController</code>.</p>