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