class Rack::Chunked

Middleware that applies chunked transfer encoding to response bodies when the response does not include a Content-Length header.

This supports the Trailer response header to allow the use of trailing headers in the chunked encoding. However, using this requires you manually specify a response body that supports a trailers method. Example:

[200, { 'Trailer' => 'Expires'}, ["Hello", "World"]]
# error raised

body = ["Hello", "World"]
def body.trailers
  { 'Expires' => Time.now.to_s }
end
[200, { 'Trailer' => 'Expires'}, body]
# No exception raised