title: CORS: Response to preflight request doesn't pass access control check
body: <p>Response to preflight request doesn't pass access control check.</p>
  
  <p><strong>XMLHttpRequest cannot load <a href="http://localhost:49531/Access/Authenticate" rel="nofollow">http://localhost:49531/Access/Authenticate</a>. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '<a href="http://localhost:31775" rel="nofollow">http://localhost:31775</a>' is therefore not allowed access.</strong></p>
  
  <p>I am flushing request coming with <code>OPTIONS</code>. Request returns with code 200, however I am still getting this error.</p>
  
  <pre><code>protected void Application_BeginRequest()
          {
              if (Request.Headers.AllKeys.Contains("Origin") &amp;&amp; Request.HttpMethod == "OPTIONS")
              {
                  Response.Flush();
                  Response.End();
              }
          }
  </code></pre>
  
  <p>What I am trying to do is to adding a token to <code>header</code> from client side and server side. Once client has been authenticated, token is added to request from server. From next request initiated from client, this token is sent by javascript.</p>