title: Return empty response from Apache
body: <p>I'm using Apache to return CORS responses to speed-up the requests (previously I handled this in application code but this was too slow). In my VirtualHost, I have the following Apache code:</p>
  
  <pre><code>SetEnvIfNoCase Access-Control-Request-Method "(GET|POST|PUT|DELETE|OPTIONS)" IsPreflight=1
  SetEnvIfNoCase Origin "http(s)?://(myorigin.com)$" AccessControlAllowOrigin=$0$1
  
  Header always set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin
  Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" env=IsPreflight
  Header always set Access-Control-Allow-Headers "Content-Type, Authorization, Accept" env=IsPreflight
  Header always set Access-Control-Max-Age "7200" env=IsPreflight
  
  RewriteEngine On   
  RewriteCond %{REQUEST_METHOD} OPTIONS
  RewriteCond %{ENV:IsPreflight} 1
  RewriteRule ^(.*)$ $1 [R=200,L]
  </code></pre>
  
  <p>This actually works surprinsigly good. It detects if the request is a preflight request, and if it is, it sends the appropriate headers. There is only one catch: the preflight request returns 200 (so the browser sends the normal request), but the body is a 200 ERROR (haha):</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;200 OK&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;OK&lt;/h1&gt;
  &lt;p&gt;The server encountered an internal error or
  misconfiguration and was unable to complete
  your request.&lt;/p&gt;
  &lt;p&gt;Please contact the server administrator at 
   you@example.com to inform them of the time this error occurred,
   and the actions you performed just before this error.&lt;/p&gt;
  &lt;p&gt;More information about this error may be available
  in the server error log.&lt;/p&gt;
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>While this works correctly, I'd like to remove this ugly error from the preflight body, but I didn't find any way to tell Apache to actually returns an empty body.</p>
  
  <p>Thanks!</p>