title: How to return truly empty body in rails? i.e. content-length 0
body: <p>I'm trying to return a 200 status with an empty body but rails returns a body with a single space. i.e. content-length 1</p>
  
  <p>For instance, this code generates a body with the single space</p>
  
  <pre><code>respond_to do |f|
    f.html {head :ok}
  end
  </code></pre>
  
  <p>and so does this</p>
  
  <pre><code>respond_to do |f|
    f.html {render :nothing =&gt; true}
  end
  </code></pre>
  
  <p>Yes, even render :nothing generates something. </p>
  
  <p>All of this seems to be flowing from a 2005 patch in rails that was designed to fix a bug in Safari where it would ignore the headers if the body was empty. (<a href="http://dev.rubyonrails.org/changeset/1818" rel="noreferrer">http://dev.rubyonrails.org/changeset/1818</a>) </p>
  
  <p>Does anyone have any thoughts on how to get a 200 status but with a truly empty body? Background: I'm using an API that makes calls to my controllers. I need to send a 200 but the single space body causes the API to malfunction (parse error...). Also, I'll be deploying to Heroku so I can't patch ActionPack to undo the 2005 hack. </p>
  
  <p>Thanks for any thoughts. </p>