private Method

AbstractResponse.set_content_length!

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
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.