Don’t set the Content-Length for block-based bodies as that would mean reading it all into memory. Not nice for, say, a 2GB streaming file.
Source Code
# File action_controller/response.rb, line 72 def set_content_length! self.headers["Content-Length"] = body.size unless body.respond_to?(:call) end
<code/>and<pre/>for code samples.