Middleware that applies chunked transfer encoding to response bodies when the response does not include a Content-Length header.
# File lib/rack/chunked.rb, line 53 def call(env) status, headers, body = @app.call(env) headers = HeaderHash.new(headers) if ! chunkable_version?(env['HTTP_VERSION']) || STATUS_WITH_NO_ENTITY_BODY.include?(status) || headers[CONTENT_LENGTH] || headers['Transfer-Encoding'] [status, headers, body] else headers.delete(CONTENT_LENGTH) headers['Transfer-Encoding'] = 'chunked' [status, headers, Body.new(body)] end end
Generated with the Darkfish Rdoc Generator 2.