instance method set_content_length!

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.2.3 Private

Signature

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
# File actionpack/lib/action_controller/response.rb, line 184
      def set_content_length!
        unless body.respond_to?(:call) || (status && status[0..2] == '304')
          self.headers["Content-Length"] ||= body.size
        end
      end

Defined in actionpack/lib/action_controller/response.rb line 184 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::AbstractResponse

Type at least 2 characters to search.

↑↓ navigate · open · esc close