Middleware that applies chunked transfer encoding to response bodies when the response does not include a Content-Length header.
(Not documented)
# File lib/rack/chunked.rb, line 14
14: def call(env)
15: status, headers, body = @app.call(env)
16: headers = HeaderHash.new(headers)
17:
18: if env['HTTP_VERSION'] == 'HTTP/1.0' ||
19: STATUS_WITH_NO_ENTITY_BODY.include?(status) ||
20: headers['Content-Length'] ||
21: headers['Transfer-Encoding']
22: [status, headers, body]
23: else
24: dup.chunk(status, headers, body)
25: end
26: end
(Not documented)
# File lib/rack/chunked.rb, line 28
28: def chunk(status, headers, body)
29: @body = body
30: headers.delete('Content-Length')
31: headers['Transfer-Encoding'] = 'chunked'
32: [status, headers, self]
33: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.