title: How to know the request is preflight and not the actual request?
body: <p>I'm using CORS to send data to my server, which is in another domain.</p>
  
  <p>The browser send the first request to check the server (preflight) and later the main request. I'd like to know when the request is "preflighted", so I can return the headers sooner.</p>
  
  <p>I would like something like this:</p>
  
  <pre><code>if (isPreflight) {
     header('Access-Control-Allow-Origin: *');
     exit;
  } else {
     // handle the main request
  }
  </code></pre>